f655adfbea
Migrate app code into canonical feature slices, add phone-only AI digest scheduling and review, wire local notification/background task support, and cover the flow with tests.
71 lines
1.8 KiB
Dart
71 lines
1.8 KiB
Dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
/// Current sort mode for the people list.
|
|
enum PeopleSortOption { affinity, nextMoment, alphabetical }
|
|
|
|
/// Selected profile in the people workspace.
|
|
class SelectedPersonIdNotifier extends Notifier<String?> {
|
|
@override
|
|
String? build() => null;
|
|
|
|
void select(String id) {
|
|
state = id;
|
|
}
|
|
|
|
void clear() {
|
|
state = null;
|
|
}
|
|
}
|
|
|
|
final NotifierProvider<SelectedPersonIdNotifier, String?>
|
|
selectedPersonIdProvider = NotifierProvider<SelectedPersonIdNotifier, String?>(
|
|
SelectedPersonIdNotifier.new,
|
|
);
|
|
|
|
/// Search query applied to the people list.
|
|
class PeopleSearchQueryNotifier extends Notifier<String> {
|
|
@override
|
|
String build() => '';
|
|
|
|
void set(String value) {
|
|
state = value;
|
|
}
|
|
}
|
|
|
|
final NotifierProvider<PeopleSearchQueryNotifier, String>
|
|
peopleSearchQueryProvider = NotifierProvider<PeopleSearchQueryNotifier, String>(
|
|
PeopleSearchQueryNotifier.new,
|
|
);
|
|
|
|
/// Relationship filter applied to the people list.
|
|
class PeopleRelationshipFilterNotifier extends Notifier<String?> {
|
|
@override
|
|
String? build() => null;
|
|
|
|
void set(String? value) {
|
|
state = value;
|
|
}
|
|
}
|
|
|
|
final NotifierProvider<PeopleRelationshipFilterNotifier, String?>
|
|
peopleRelationshipFilterProvider =
|
|
NotifierProvider<PeopleRelationshipFilterNotifier, String?>(
|
|
PeopleRelationshipFilterNotifier.new,
|
|
);
|
|
|
|
/// Selected sort mode for the people list.
|
|
class PeopleSortOptionNotifier extends Notifier<PeopleSortOption> {
|
|
@override
|
|
PeopleSortOption build() => PeopleSortOption.affinity;
|
|
|
|
void set(PeopleSortOption value) {
|
|
state = value;
|
|
}
|
|
}
|
|
|
|
final NotifierProvider<PeopleSortOptionNotifier, PeopleSortOption>
|
|
peopleSortOptionProvider =
|
|
NotifierProvider<PeopleSortOptionNotifier, PeopleSortOption>(
|
|
PeopleSortOptionNotifier.new,
|
|
);
|