WIP - Redesigned login flow

This commit is contained in:
Anton Stubenbord
2023-01-05 01:38:00 +01:00
parent 2445c97d44
commit 738ef99bc5
60 changed files with 1159 additions and 755 deletions

View File

@@ -8,13 +8,14 @@ import 'package:paperless_mobile/features/edit_label/cubit/edit_label_state.dart
class EditLabelCubit<T extends Label> extends Cubit<EditLabelState<T>> {
final LabelRepository<T> _repository;
StreamSubscription<Map<int, T>>? _subscription;
StreamSubscription<Map<int, T>?>? _subscription;
EditLabelCubit(LabelRepository<T> repository)
: _repository = repository,
super(const EditLabelInitial()) {
_subscription = _repository.labels
.listen((labels) => emit(EditLabelState(labels: labels)));
_subscription = repository.values.listen(
(update) => emit(EditLabelState(labels: update ?? {})),
);
}
Future<T> create(T label) => _repository.create(label);