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, nd: nd,
coordinates: coordinates, coordinates: coordinates,
); );
//await widget.storageService.addPhoto(photo); await widget.storageService.addPhoto(photo);
_photos[photo.id] = photo; _photos[photo.id] = photo;
setState(() {}); setState(() {});
} else { } else {

View file

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