From 59287d06bc8936f65055a54644482ea482036088 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Sun, 19 Feb 2023 19:19:56 +0300 Subject: [PATCH] Rearranged settings screen files --- .../widget_list_tile_report_issue.dart | 0 .../widget_list_tile_source_code.dart | 0 .../version/widget_list_tile_version.dart | 0 .../widget_list_tile_write_email.dart | 0 .../about/widget_settings_section_about.dart | 25 +++++++++ .../caffeine/bloc_list_tile_caffeine.dart | 0 .../caffeine/provider_list_tile_caffeine.dart | 0 .../caffeine/widget_list_tile_caffeine.dart | 0 .../haptics/bloc_list_tile_haptics.dart | 0 .../haptics/provider_list_tile_haptics.dart | 0 .../haptics/widget_list_tile_haptics.dart | 0 .../language/widget_list_tile_language.dart | 0 .../widget_settings_section_general.dart | 23 ++++++++ .../bloc_dialog_calibration.dart | 0 .../event_dialog_calibration.dart | 0 .../provider_dialog_calibration.dart | 0 .../state_dialog_calibration.dart | 0 .../widget_dialog_calibration.dart | 0 .../widget_list_tile_calibration.dart | 0 .../widget_list_tile_fractional_stops.dart | 0 .../widget_settings_section_metering.dart | 21 +++++++ .../widget_list_tile_dynamic_color.dart | 0 .../widget_dialog_picker_primary_color.dart | 0 .../widget_list_tile_primary_color.dart | 0 .../widget_list_tile_theme_type.dart | 0 .../theme/widget_settings_section_theme.dart | 26 +++++++++ lib/screens/settings/screen_settings.dart | 56 +++---------------- 27 files changed, 103 insertions(+), 48 deletions(-) rename lib/screens/settings/components/{ => about/components}/report_issue/widget_list_tile_report_issue.dart (100%) rename lib/screens/settings/components/{ => about/components}/source_code/widget_list_tile_source_code.dart (100%) rename lib/screens/settings/components/{ => about/components}/version/widget_list_tile_version.dart (100%) rename lib/screens/settings/components/{ => about/components}/write_email/widget_list_tile_write_email.dart (100%) create mode 100644 lib/screens/settings/components/about/widget_settings_section_about.dart rename lib/screens/settings/components/{ => general/components}/caffeine/bloc_list_tile_caffeine.dart (100%) rename lib/screens/settings/components/{ => general/components}/caffeine/provider_list_tile_caffeine.dart (100%) rename lib/screens/settings/components/{ => general/components}/caffeine/widget_list_tile_caffeine.dart (100%) rename lib/screens/settings/components/{ => general/components}/haptics/bloc_list_tile_haptics.dart (100%) rename lib/screens/settings/components/{ => general/components}/haptics/provider_list_tile_haptics.dart (100%) rename lib/screens/settings/components/{ => general/components}/haptics/widget_list_tile_haptics.dart (100%) rename lib/screens/settings/components/{ => general/components}/language/widget_list_tile_language.dart (100%) create mode 100644 lib/screens/settings/components/general/widget_settings_section_general.dart rename lib/screens/settings/components/{ => metering/components}/calibration/components/calibration_dialog/bloc_dialog_calibration.dart (100%) rename lib/screens/settings/components/{ => metering/components}/calibration/components/calibration_dialog/event_dialog_calibration.dart (100%) rename lib/screens/settings/components/{ => metering/components}/calibration/components/calibration_dialog/provider_dialog_calibration.dart (100%) rename lib/screens/settings/components/{ => metering/components}/calibration/components/calibration_dialog/state_dialog_calibration.dart (100%) rename lib/screens/settings/components/{ => metering/components}/calibration/components/calibration_dialog/widget_dialog_calibration.dart (100%) rename lib/screens/settings/components/{ => metering/components}/calibration/widget_list_tile_calibration.dart (100%) rename lib/screens/settings/components/{ => metering/components}/fractional_stops/widget_list_tile_fractional_stops.dart (100%) create mode 100644 lib/screens/settings/components/metering/widget_settings_section_metering.dart rename lib/screens/settings/components/{ => theme/components}/dynamic_color/widget_list_tile_dynamic_color.dart (100%) rename lib/screens/settings/components/{ => theme/components}/primary_color/components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart (100%) rename lib/screens/settings/components/{ => theme/components}/primary_color/widget_list_tile_primary_color.dart (100%) rename lib/screens/settings/components/{ => theme/components}/theme_type/widget_list_tile_theme_type.dart (100%) create mode 100644 lib/screens/settings/components/theme/widget_settings_section_theme.dart diff --git a/lib/screens/settings/components/report_issue/widget_list_tile_report_issue.dart b/lib/screens/settings/components/about/components/report_issue/widget_list_tile_report_issue.dart similarity index 100% rename from lib/screens/settings/components/report_issue/widget_list_tile_report_issue.dart rename to lib/screens/settings/components/about/components/report_issue/widget_list_tile_report_issue.dart diff --git a/lib/screens/settings/components/source_code/widget_list_tile_source_code.dart b/lib/screens/settings/components/about/components/source_code/widget_list_tile_source_code.dart similarity index 100% rename from lib/screens/settings/components/source_code/widget_list_tile_source_code.dart rename to lib/screens/settings/components/about/components/source_code/widget_list_tile_source_code.dart diff --git a/lib/screens/settings/components/version/widget_list_tile_version.dart b/lib/screens/settings/components/about/components/version/widget_list_tile_version.dart similarity index 100% rename from lib/screens/settings/components/version/widget_list_tile_version.dart rename to lib/screens/settings/components/about/components/version/widget_list_tile_version.dart diff --git a/lib/screens/settings/components/write_email/widget_list_tile_write_email.dart b/lib/screens/settings/components/about/components/write_email/widget_list_tile_write_email.dart similarity index 100% rename from lib/screens/settings/components/write_email/widget_list_tile_write_email.dart rename to lib/screens/settings/components/about/components/write_email/widget_list_tile_write_email.dart diff --git a/lib/screens/settings/components/about/widget_settings_section_about.dart b/lib/screens/settings/components/about/widget_settings_section_about.dart new file mode 100644 index 0000000..89e3cf2 --- /dev/null +++ b/lib/screens/settings/components/about/widget_settings_section_about.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; +import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart'; + +import 'components/report_issue/widget_list_tile_report_issue.dart'; +import 'components/source_code/widget_list_tile_source_code.dart'; +import 'components/version/widget_list_tile_version.dart'; +import 'components/write_email/widget_list_tile_write_email.dart'; + +class AboutSettingsSection extends StatelessWidget { + const AboutSettingsSection({super.key}); + + @override + Widget build(BuildContext context) { + return SettingsSection( + title: S.of(context).about, + children: const [ + SourceCodeListTile(), + ReportIssueListTile(), + WriteEmailListTile(), + VersionListTile(), + ], + ); + } +} diff --git a/lib/screens/settings/components/caffeine/bloc_list_tile_caffeine.dart b/lib/screens/settings/components/general/components/caffeine/bloc_list_tile_caffeine.dart similarity index 100% rename from lib/screens/settings/components/caffeine/bloc_list_tile_caffeine.dart rename to lib/screens/settings/components/general/components/caffeine/bloc_list_tile_caffeine.dart diff --git a/lib/screens/settings/components/caffeine/provider_list_tile_caffeine.dart b/lib/screens/settings/components/general/components/caffeine/provider_list_tile_caffeine.dart similarity index 100% rename from lib/screens/settings/components/caffeine/provider_list_tile_caffeine.dart rename to lib/screens/settings/components/general/components/caffeine/provider_list_tile_caffeine.dart diff --git a/lib/screens/settings/components/caffeine/widget_list_tile_caffeine.dart b/lib/screens/settings/components/general/components/caffeine/widget_list_tile_caffeine.dart similarity index 100% rename from lib/screens/settings/components/caffeine/widget_list_tile_caffeine.dart rename to lib/screens/settings/components/general/components/caffeine/widget_list_tile_caffeine.dart diff --git a/lib/screens/settings/components/haptics/bloc_list_tile_haptics.dart b/lib/screens/settings/components/general/components/haptics/bloc_list_tile_haptics.dart similarity index 100% rename from lib/screens/settings/components/haptics/bloc_list_tile_haptics.dart rename to lib/screens/settings/components/general/components/haptics/bloc_list_tile_haptics.dart diff --git a/lib/screens/settings/components/haptics/provider_list_tile_haptics.dart b/lib/screens/settings/components/general/components/haptics/provider_list_tile_haptics.dart similarity index 100% rename from lib/screens/settings/components/haptics/provider_list_tile_haptics.dart rename to lib/screens/settings/components/general/components/haptics/provider_list_tile_haptics.dart diff --git a/lib/screens/settings/components/haptics/widget_list_tile_haptics.dart b/lib/screens/settings/components/general/components/haptics/widget_list_tile_haptics.dart similarity index 100% rename from lib/screens/settings/components/haptics/widget_list_tile_haptics.dart rename to lib/screens/settings/components/general/components/haptics/widget_list_tile_haptics.dart diff --git a/lib/screens/settings/components/language/widget_list_tile_language.dart b/lib/screens/settings/components/general/components/language/widget_list_tile_language.dart similarity index 100% rename from lib/screens/settings/components/language/widget_list_tile_language.dart rename to lib/screens/settings/components/general/components/language/widget_list_tile_language.dart diff --git a/lib/screens/settings/components/general/widget_settings_section_general.dart b/lib/screens/settings/components/general/widget_settings_section_general.dart new file mode 100644 index 0000000..7a2d836 --- /dev/null +++ b/lib/screens/settings/components/general/widget_settings_section_general.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; +import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart'; + +import 'components/caffeine/provider_list_tile_caffeine.dart'; +import 'components/haptics/provider_list_tile_haptics.dart'; +import 'components/language/widget_list_tile_language.dart'; + +class GeneralSettingsSection extends StatelessWidget { + const GeneralSettingsSection({super.key}); + + @override + Widget build(BuildContext context) { + return SettingsSection( + title: S.of(context).general, + children: const [ + CaffeineListTileProvider(), + HapticsListTileProvider(), + LanguageListTile(), + ], + ); + } +} diff --git a/lib/screens/settings/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart b/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart similarity index 100% rename from lib/screens/settings/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart rename to lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/bloc_dialog_calibration.dart diff --git a/lib/screens/settings/components/calibration/components/calibration_dialog/event_dialog_calibration.dart b/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/event_dialog_calibration.dart similarity index 100% rename from lib/screens/settings/components/calibration/components/calibration_dialog/event_dialog_calibration.dart rename to lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/event_dialog_calibration.dart diff --git a/lib/screens/settings/components/calibration/components/calibration_dialog/provider_dialog_calibration.dart b/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/provider_dialog_calibration.dart similarity index 100% rename from lib/screens/settings/components/calibration/components/calibration_dialog/provider_dialog_calibration.dart rename to lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/provider_dialog_calibration.dart diff --git a/lib/screens/settings/components/calibration/components/calibration_dialog/state_dialog_calibration.dart b/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/state_dialog_calibration.dart similarity index 100% rename from lib/screens/settings/components/calibration/components/calibration_dialog/state_dialog_calibration.dart rename to lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/state_dialog_calibration.dart diff --git a/lib/screens/settings/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart b/lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart similarity index 100% rename from lib/screens/settings/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart rename to lib/screens/settings/components/metering/components/calibration/components/calibration_dialog/widget_dialog_calibration.dart diff --git a/lib/screens/settings/components/calibration/widget_list_tile_calibration.dart b/lib/screens/settings/components/metering/components/calibration/widget_list_tile_calibration.dart similarity index 100% rename from lib/screens/settings/components/calibration/widget_list_tile_calibration.dart rename to lib/screens/settings/components/metering/components/calibration/widget_list_tile_calibration.dart diff --git a/lib/screens/settings/components/fractional_stops/widget_list_tile_fractional_stops.dart b/lib/screens/settings/components/metering/components/fractional_stops/widget_list_tile_fractional_stops.dart similarity index 100% rename from lib/screens/settings/components/fractional_stops/widget_list_tile_fractional_stops.dart rename to lib/screens/settings/components/metering/components/fractional_stops/widget_list_tile_fractional_stops.dart diff --git a/lib/screens/settings/components/metering/widget_settings_section_metering.dart b/lib/screens/settings/components/metering/widget_settings_section_metering.dart new file mode 100644 index 0000000..d313597 --- /dev/null +++ b/lib/screens/settings/components/metering/widget_settings_section_metering.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; +import 'package:lightmeter/generated/l10n.dart'; +import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart'; + +import 'components/calibration/widget_list_tile_calibration.dart'; +import 'components/fractional_stops/widget_list_tile_fractional_stops.dart'; + +class MeteringSettingsSection extends StatelessWidget { + const MeteringSettingsSection({super.key}); + + @override + Widget build(BuildContext context) { + return SettingsSection( + title: S.of(context).metering, + children: const [ + StopTypeListTile(), + CalibrationListTile(), + ], + ); + } +} diff --git a/lib/screens/settings/components/dynamic_color/widget_list_tile_dynamic_color.dart b/lib/screens/settings/components/theme/components/dynamic_color/widget_list_tile_dynamic_color.dart similarity index 100% rename from lib/screens/settings/components/dynamic_color/widget_list_tile_dynamic_color.dart rename to lib/screens/settings/components/theme/components/dynamic_color/widget_list_tile_dynamic_color.dart diff --git a/lib/screens/settings/components/primary_color/components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart b/lib/screens/settings/components/theme/components/primary_color/components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart similarity index 100% rename from lib/screens/settings/components/primary_color/components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart rename to lib/screens/settings/components/theme/components/primary_color/components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart diff --git a/lib/screens/settings/components/primary_color/widget_list_tile_primary_color.dart b/lib/screens/settings/components/theme/components/primary_color/widget_list_tile_primary_color.dart similarity index 100% rename from lib/screens/settings/components/primary_color/widget_list_tile_primary_color.dart rename to lib/screens/settings/components/theme/components/primary_color/widget_list_tile_primary_color.dart diff --git a/lib/screens/settings/components/theme_type/widget_list_tile_theme_type.dart b/lib/screens/settings/components/theme/components/theme_type/widget_list_tile_theme_type.dart similarity index 100% rename from lib/screens/settings/components/theme_type/widget_list_tile_theme_type.dart rename to lib/screens/settings/components/theme/components/theme_type/widget_list_tile_theme_type.dart diff --git a/lib/screens/settings/components/theme/widget_settings_section_theme.dart b/lib/screens/settings/components/theme/widget_settings_section_theme.dart new file mode 100644 index 0000000..7df9365 --- /dev/null +++ b/lib/screens/settings/components/theme/widget_settings_section_theme.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:lightmeter/data/models/dynamic_colors_state.dart'; +import 'package:lightmeter/generated/l10n.dart'; +import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart'; + +import 'components/dynamic_color/widget_list_tile_dynamic_color.dart'; +import 'components/primary_color/widget_list_tile_primary_color.dart'; +import 'components/theme_type/widget_list_tile_theme_type.dart'; + +class ThemeSettingsSection extends StatelessWidget { + const ThemeSettingsSection({super.key}); + + @override + Widget build(BuildContext context) { + return SettingsSection( + title: S.of(context).theme, + children: [ + const ThemeTypeListTile(), + const PrimaryColorListTile(), + if (context.read() != DynamicColorState.unavailable) + const DynamicColorListTile(), + ], + ); + } +} diff --git a/lib/screens/settings/screen_settings.dart b/lib/screens/settings/screen_settings.dart index a1f3242..6f225ff 100644 --- a/lib/screens/settings/screen_settings.dart +++ b/lib/screens/settings/screen_settings.dart @@ -1,22 +1,11 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/data/models/dynamic_colors_state.dart'; import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'package:provider/provider.dart'; -import 'components/caffeine/provider_list_tile_caffeine.dart'; -import 'components/calibration/widget_list_tile_calibration.dart'; -import 'components/haptics/provider_list_tile_haptics.dart'; -import 'components/language/widget_list_tile_language.dart'; -import 'components/primary_color/widget_list_tile_primary_color.dart'; -import 'components/report_issue/widget_list_tile_report_issue.dart'; -import 'components/shared/settings_section/widget_settings_section.dart'; -import 'components/source_code/widget_list_tile_source_code.dart'; -import 'components/dynamic_color/widget_list_tile_dynamic_color.dart'; -import 'components/theme_type/widget_list_tile_theme_type.dart'; -import 'components/version/widget_list_tile_version.dart'; -import 'components/fractional_stops/widget_list_tile_fractional_stops.dart'; -import 'components/write_email/widget_list_tile_write_email.dart'; +import 'components/about/widget_settings_section_about.dart'; +import 'components/general/widget_settings_section_general.dart'; +import 'components/metering/widget_settings_section_metering.dart'; +import 'components/theme/widget_settings_section_theme.dart'; class SettingsScreen extends StatelessWidget { const SettingsScreen({super.key}); @@ -54,39 +43,10 @@ class SettingsScreen extends StatelessWidget { SliverList( delegate: SliverChildListDelegate( [ - SettingsSection( - title: S.of(context).metering, - children: const [ - StopTypeListTile(), - CalibrationListTile(), - ], - ), - SettingsSection( - title: S.of(context).general, - children: const [ - CaffeineListTileProvider(), - HapticsListTileProvider(), - LanguageListTile(), - ], - ), - SettingsSection( - title: S.of(context).theme, - children: [ - const ThemeTypeListTile(), - const PrimaryColorListTile(), - if (context.read() != DynamicColorState.unavailable) - const DynamicColorListTile(), - ], - ), - SettingsSection( - title: S.of(context).about, - children: const [ - SourceCodeListTile(), - ReportIssueListTile(), - WriteEmailListTile(), - VersionListTile(), - ], - ), + const MeteringSettingsSection(), + const GeneralSettingsSection(), + const ThemeSettingsSection(), + const AboutSettingsSection(), SizedBox(height: MediaQuery.of(context).padding.bottom), ], ),