fixed updating photos

This commit is contained in:
Vadim 2025-07-11 22:36:03 +02:00
parent 812d3b281a
commit 02f60956e3
2 changed files with 5 additions and 3 deletions

View file

@ -83,7 +83,7 @@ class LogbookPhotosProviderState extends State<LogbookPhotosProvider> {
nd: nd,
coordinates: coordinates,
);
//await widget.storageService.addPhoto(photo);
await widget.storageService.addPhoto(photo);
_photos[photo.id] = photo;
setState(() {});
} else {

View file

@ -23,6 +23,8 @@ class LogbookPhotoEditBloc extends Bloc<LogbookPhotoEditEvent, LogbookPhotoEditS
iso: photo.iso,
nd: photo.nd,
coordinates: photo.coordinates,
aperture: photo.apertureValue,
shutterSpeed: photo.shutterSpeedValue,
note: photo.note,
canSave: false,
),
@ -46,7 +48,7 @@ class LogbookPhotoEditBloc extends Bloc<LogbookPhotoEditEvent, LogbookPhotoEditS
}
Future<void> _onApertureChanged(LogbookPhotoApertureChangedEvent event, Emitter emit) async {
_newPhoto = _newPhoto.copyWith(apertureValue: event.aperture);
_newPhoto = _newPhoto.copyWith(apertureValue: Optional(event.aperture));
emit(
state.copyWith(
aperture: event.aperture,
@ -56,7 +58,7 @@ class LogbookPhotoEditBloc extends Bloc<LogbookPhotoEditEvent, LogbookPhotoEditS
}
Future<void> _onShutterSpeedChanged(LogbookPhotoShutterSpeedChangedEvent event, Emitter emit) async {
_newPhoto = _newPhoto.copyWith(shutterSpeedValue: event.shutterSpeed);
_newPhoto = _newPhoto.copyWith(shutterSpeedValue: Optional(event.shutterSpeed));
emit(
state.copyWith(
shutterSpeed: event.shutterSpeed,