mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-26 01:10:39 +00:00
update equipment profile from dialog
This commit is contained in:
parent
16c81a7116
commit
46ee72174f
2 changed files with 5 additions and 9 deletions
|
@ -84,16 +84,8 @@ class _InheritedListeners extends StatelessWidget {
|
||||||
context.read<MeteringBloc>().add(const FilmChangedEvent(Film.other()));
|
context.read<MeteringBloc>().add(const FilmChangedEvent(Film.other()));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: MeteringScreenLayoutFeatureListener(
|
|
||||||
feature: MeteringScreenLayoutFeature.equipmentProfiles,
|
|
||||||
onDidChangeDependencies: (value) {
|
|
||||||
if (!value) {
|
|
||||||
EquipmentProfileProvider.of(context).setProfile(EquipmentProfiles.of(context).first);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:lightmeter/data/models/metering_screen_layout_config.dart';
|
||||||
import 'package:lightmeter/generated/l10n.dart';
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
import 'package:lightmeter/res/dimens.dart';
|
||||||
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
|
|
||||||
class MeteringScreenLayoutFeaturesDialog extends StatefulWidget {
|
class MeteringScreenLayoutFeaturesDialog extends StatefulWidget {
|
||||||
const MeteringScreenLayoutFeaturesDialog({super.key});
|
const MeteringScreenLayoutFeaturesDialog({super.key});
|
||||||
|
@ -48,6 +49,9 @@ class _MeteringScreenLayoutFeaturesDialogState extends State<MeteringScreenLayou
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
if (!_features[MeteringScreenLayoutFeature.equipmentProfiles]!) {
|
||||||
|
EquipmentProfileProvider.of(context).setProfile(EquipmentProfiles.of(context).first);
|
||||||
|
}
|
||||||
UserPreferencesProvider.of(context).setMeteringScreenLayout(_features);
|
UserPreferencesProvider.of(context).setMeteringScreenLayout(_features);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue