2022-10-30 18:23:06 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-10-30 18:59:33 +00:00
|
|
|
import 'package:lightmeter/generated/l10n.dart';
|
2023-05-11 13:30:18 +00:00
|
|
|
import 'package:lightmeter/screens/settings/components/about/widget_settings_section_about.dart';
|
2023-09-14 14:59:16 +00:00
|
|
|
import 'package:lightmeter/screens/settings/components/equipment/widget_settings_section_equipment.dart';
|
2023-05-11 13:30:18 +00:00
|
|
|
import 'package:lightmeter/screens/settings/components/general/widget_settings_section_general.dart';
|
2023-09-17 20:29:02 +00:00
|
|
|
import 'package:lightmeter/screens/settings/components/lightmeter_pro/widget_settings_section_lightmeter_pro.dart';
|
2023-05-11 13:30:18 +00:00
|
|
|
import 'package:lightmeter/screens/settings/components/metering/widget_settings_section_metering.dart';
|
|
|
|
import 'package:lightmeter/screens/settings/components/theme/widget_settings_section_theme.dart';
|
2023-08-14 10:25:37 +00:00
|
|
|
import 'package:lightmeter/screens/settings/flow_settings.dart';
|
2023-03-30 19:24:18 +00:00
|
|
|
import 'package:lightmeter/screens/shared/sliver_screen/screen_sliver.dart';
|
2023-09-17 20:29:02 +00:00
|
|
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
2022-10-30 18:59:33 +00:00
|
|
|
|
2023-07-09 11:39:33 +00:00
|
|
|
class SettingsScreen extends StatefulWidget {
|
2022-10-30 18:23:06 +00:00
|
|
|
const SettingsScreen({super.key});
|
|
|
|
|
2023-07-09 11:39:33 +00:00
|
|
|
@override
|
|
|
|
State<SettingsScreen> createState() => _SettingsScreenState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _SettingsScreenState extends State<SettingsScreen> {
|
|
|
|
@override
|
|
|
|
void didChangeDependencies() {
|
|
|
|
super.didChangeDependencies();
|
2023-08-14 10:25:37 +00:00
|
|
|
SettingsInteractorProvider.of(context).disableVolumeHandling();
|
2023-07-09 11:39:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void deactivate() {
|
2023-08-14 10:25:37 +00:00
|
|
|
SettingsInteractorProvider.of(context).restoreVolumeHandling();
|
2023-07-09 11:39:33 +00:00
|
|
|
super.deactivate();
|
|
|
|
}
|
|
|
|
|
2022-10-30 18:23:06 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-05-10 15:05:27 +00:00
|
|
|
return ScaffoldMessenger(
|
|
|
|
child: SliverScreen(
|
|
|
|
title: S.of(context).settings,
|
|
|
|
appBarActions: [
|
|
|
|
IconButton(
|
|
|
|
onPressed: Navigator.of(context).pop,
|
|
|
|
icon: const Icon(Icons.close),
|
2023-03-30 19:24:18 +00:00
|
|
|
),
|
2023-05-10 15:05:27 +00:00
|
|
|
],
|
|
|
|
slivers: [
|
|
|
|
SliverList(
|
|
|
|
delegate: SliverChildListDelegate(
|
|
|
|
<Widget>[
|
2023-09-17 20:29:02 +00:00
|
|
|
if (!IAPProducts.isPurchased(context, IAPProductType.paidFeatures))
|
|
|
|
const LightmeterProSettingsSection(),
|
2023-05-10 15:05:27 +00:00
|
|
|
const MeteringSettingsSection(),
|
2023-09-14 14:59:16 +00:00
|
|
|
const EquipmentSettingsSection(),
|
2023-05-10 15:05:27 +00:00
|
|
|
const GeneralSettingsSection(),
|
|
|
|
const ThemeSettingsSection(),
|
|
|
|
const AboutSettingsSection(),
|
|
|
|
SizedBox(height: MediaQuery.of(context).padding.bottom),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2023-09-02 08:32:08 +00:00
|
|
|
SliverToBoxAdapter(child: SizedBox(height: MediaQuery.paddingOf(context).bottom)),
|
2023-05-10 15:05:27 +00:00
|
|
|
],
|
|
|
|
),
|
2022-10-30 18:23:06 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|