mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-08-13 16:46:42 +00:00
allow more free actions
This commit is contained in:
parent
e4bb7588ef
commit
82669bc5e5
10 changed files with 48 additions and 86 deletions
|
@ -6,6 +6,7 @@ import 'package:lightmeter/res/dimens.dart';
|
|||
import 'package:lightmeter/screens/equipment_profile_edit/flow_equipment_profile_edit.dart';
|
||||
import 'package:lightmeter/screens/shared/sliver_placeholder/widget_sliver_placeholder.dart';
|
||||
import 'package:lightmeter/screens/shared/sliver_screen/screen_sliver.dart';
|
||||
import 'package:lightmeter/utils/guard_pro_tap.dart';
|
||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||
|
||||
class EquipmentProfilesScreen extends StatefulWidget {
|
||||
|
@ -41,9 +42,14 @@ class _EquipmentProfilesScreenState extends State<EquipmentProfilesScreen> with
|
|||
}
|
||||
|
||||
void _addProfile() {
|
||||
Navigator.of(context).pushNamed(
|
||||
NavigationRoutes.equipmentProfileEditScreen.name,
|
||||
arguments: const EquipmentProfileEditArgs(editType: EquipmentProfileEditType.add),
|
||||
guardProTap(
|
||||
context,
|
||||
() {
|
||||
Navigator.of(context).pushNamed(
|
||||
NavigationRoutes.equipmentProfileEditScreen.name,
|
||||
arguments: const EquipmentProfileEditArgs(editType: EquipmentProfileEditType.add),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import 'package:lightmeter/res/dimens.dart';
|
|||
import 'package:lightmeter/screens/logbook_photos/components/grid_tile/widget_grid_tile_logbook_photo.dart';
|
||||
import 'package:lightmeter/screens/shared/icon_placeholder/widget_icon_placeholder.dart';
|
||||
import 'package:lightmeter/screens/shared/sliver_screen/screen_sliver.dart';
|
||||
import 'package:lightmeter/utils/context_utils.dart';
|
||||
import 'package:lightmeter/utils/guard_pro_tap.dart';
|
||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||
|
||||
class LogbookPhotosScreen extends StatefulWidget {
|
||||
|
@ -30,8 +32,15 @@ class _LogbookPhotosScreenState extends State<LogbookPhotosScreen> with SingleTi
|
|||
child: SwitchListTile(
|
||||
secondary: const Icon(Icons.book_outlined),
|
||||
title: Text(S.of(context).saveNewPhotos),
|
||||
value: LogbookPhotos.isEnabledOf(context),
|
||||
onChanged: LogbookPhotosProvider.of(context).saveLogbookPhotos,
|
||||
value: LogbookPhotos.isEnabledOf(context) && context.isPro,
|
||||
onChanged: (value) {
|
||||
guardProTap(
|
||||
context,
|
||||
() {
|
||||
Navigator.of(context).pushNamed(NavigationRoutes.proFeaturesScreen.name);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -4,7 +4,6 @@ import 'package:lightmeter/generated/l10n.dart';
|
|||
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
||||
import 'package:lightmeter/screens/shared/animated_circular_button/widget_button_circular_animated.dart';
|
||||
import 'package:lightmeter/screens/shared/bottom_controls_bar/widget_bottom_controls_bar.dart';
|
||||
import 'package:lightmeter/utils/context_utils.dart';
|
||||
|
||||
class MeteringBottomControls extends StatelessWidget {
|
||||
final double? ev;
|
||||
|
@ -76,7 +75,7 @@ class _EvValueText extends StatelessWidget {
|
|||
}
|
||||
|
||||
String _text(BuildContext context) {
|
||||
final bool showEv100 = context.isPro && UserPreferencesProvider.showEv100Of(context);
|
||||
final bool showEv100 = UserPreferencesProvider.showEv100Of(context);
|
||||
final StringBuffer buffer = StringBuffer()
|
||||
..writeAll([
|
||||
(showEv100 ? ev100 : ev).toStringAsFixed(1),
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/navigation/routes.dart';
|
||||
import 'package:lightmeter/screens/settings/components/shared/iap_list_tile/widget_list_tile_iap.dart';
|
||||
|
||||
class LogbookListTile extends StatelessWidget {
|
||||
const LogbookListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IAPListTile(
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.book_outlined),
|
||||
title: Text(S.of(context).logbook),
|
||||
onTap: () {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/res/dimens.dart';
|
||||
import 'package:lightmeter/screens/settings/components/general/components/timer/bloc_list_tile_timer.dart';
|
||||
import 'package:lightmeter/screens/settings/components/shared/iap_switch_list_tile/widget_iap_switch_list_tile.dart';
|
||||
import 'package:lightmeter/utils/context_utils.dart';
|
||||
import 'package:lightmeter/utils/guard_pro_tap.dart';
|
||||
|
||||
class TimerListTile extends StatelessWidget {
|
||||
const TimerListTile({super.key});
|
||||
|
@ -10,11 +12,17 @@ class TimerListTile extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<TimerListTileBloc, bool>(
|
||||
builder: (context, state) => IAPSwitchListTile(
|
||||
builder: (context, state) => SwitchListTile(
|
||||
secondary: const Icon(Icons.timer_outlined),
|
||||
title: Text(S.of(context).autostartTimer),
|
||||
value: state,
|
||||
onChanged: context.read<TimerListTileBloc>().onChanged,
|
||||
value: context.isPro && state,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
||||
onChanged: (value) {
|
||||
guardProTap(
|
||||
context,
|
||||
() => context.read<TimerListTileBloc>().onChanged(value),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/navigation/routes.dart';
|
||||
import 'package:lightmeter/screens/settings/components/shared/iap_list_tile/widget_list_tile_iap.dart';
|
||||
|
||||
class EquipmentProfilesListTile extends StatelessWidget {
|
||||
const EquipmentProfilesListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IAPListTile(
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.camera_outlined),
|
||||
title: Text(S.of(context).equipmentProfiles),
|
||||
onTap: () {
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/navigation/routes.dart';
|
||||
import 'package:lightmeter/screens/settings/components/shared/iap_list_tile/widget_list_tile_iap.dart';
|
||||
import 'package:lightmeter/utils/guard_pro_tap.dart';
|
||||
|
||||
class FilmsListTile extends StatelessWidget {
|
||||
const FilmsListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IAPListTile(
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.camera_roll_outlined),
|
||||
title: Text(S.of(context).films),
|
||||
onTap: () => Navigator.of(context).pushNamed(NavigationRoutes.filmsListScreen.name),
|
||||
onTap: () {
|
||||
guardProTap(
|
||||
context,
|
||||
() {
|
||||
Navigator.of(context).pushNamed(NavigationRoutes.filmsListScreen.name);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/providers/user_preferences_provider.dart';
|
||||
import 'package:lightmeter/screens/settings/components/shared/iap_switch_list_tile/widget_iap_switch_list_tile.dart';
|
||||
import 'package:lightmeter/res/dimens.dart';
|
||||
|
||||
class ShowEv100ListTile extends StatelessWidget {
|
||||
const ShowEv100ListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IAPSwitchListTile(
|
||||
return SwitchListTile(
|
||||
secondary: const Icon(Icons.adjust_outlined),
|
||||
title: Text(S.of(context).showEv100),
|
||||
value: UserPreferencesProvider.showEv100Of(context),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
||||
onChanged: (_) => UserPreferencesProvider.of(context).toggleShowEv100(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/navigation/routes.dart';
|
||||
import 'package:lightmeter/utils/context_utils.dart';
|
||||
|
||||
class IAPListTile extends StatelessWidget {
|
||||
final Icon leading;
|
||||
final Text title;
|
||||
final VoidCallback onTap;
|
||||
|
||||
const IAPListTile({
|
||||
required this.leading,
|
||||
required this.title,
|
||||
required this.onTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
leading: leading,
|
||||
title: title,
|
||||
onTap: context.isPro
|
||||
? onTap
|
||||
: () {
|
||||
Navigator.of(context).pushNamed(NavigationRoutes.proFeaturesScreen.name);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/navigation/routes.dart';
|
||||
import 'package:lightmeter/res/dimens.dart';
|
||||
import 'package:lightmeter/utils/context_utils.dart';
|
||||
|
||||
class IAPSwitchListTile extends StatelessWidget {
|
||||
final Icon secondary;
|
||||
final Text title;
|
||||
final Text? subtitle;
|
||||
final bool value;
|
||||
final ValueChanged<bool>? onChanged;
|
||||
|
||||
const IAPSwitchListTile({
|
||||
required this.secondary,
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
required this.value,
|
||||
required this.onChanged,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SwitchListTile(
|
||||
secondary: secondary,
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
value: context.isPro && value,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
||||
onChanged: context.isPro
|
||||
? onChanged
|
||||
: (_) {
|
||||
Navigator.of(context).pushNamed(NavigationRoutes.proFeaturesScreen.name);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue