mirror of https://github.com/AMT-Cheif/drift.git
13 lines
346 B
Dart
13 lines
346 B
Dart
import 'package:riverpod/riverpod.dart';
|
|
|
|
import '../../database/database.dart';
|
|
|
|
final activeCategory = StateProvider<Category?>((_) => null);
|
|
|
|
final entriesInCategory = StreamProvider((ref) {
|
|
final database = ref.watch(AppDatabase.provider);
|
|
final current = ref.watch(activeCategory)?.id;
|
|
|
|
return database.entriesInCategory(current);
|
|
});
|