Implemented note templates and enhanced usability by adjusting the dimension of the note dialogs

This commit is contained in:
Dennis Nemec
2026-01-08 14:10:21 +01:00
parent 6a53d2d716
commit ffdd7fa0ff
6 changed files with 98 additions and 56 deletions

View File

@ -25,15 +25,17 @@ class NoteBloc extends Bloc<NoteEvent, NoteState> {
required this.opBloc,
required this.deliveryId,
}) : super(NoteInitial()) {
_combinedSubscription = CombineLatestStream.combine2(
_combinedSubscription = CombineLatestStream.combine3(
repository.notes,
repository.images,
(note, image) => {"note": note, "image": image},
repository.templates,
(note, image, templates) => {"note": note, "image": image, "templates": templates},
).listen(
(data) => add(
DataUpdated(
images: data["image"] as List<ImageNote>,
notes: data["note"] as List<Note>,
templates: data["templates"] as List<NoteTemplate>
),
),
);
@ -56,7 +58,7 @@ class NoteBloc extends Bloc<NoteEvent, NoteState> {
}
Future<void> _dataUpdated(DataUpdated event, Emitter<NoteState> emit) async {
emit(NoteLoaded(notes: event.notes, images: event.images));
emit(NoteLoaded(notes: event.notes, images: event.images, templates: event.templates));
}
Future<void> _reset(ResetNotes event, Emitter<NoteState> emit) async {