From 14bac950cf9c1bad17400c78378939f8b99a18e2 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Sun, 18 Dec 2022 12:03:41 +0300 Subject: [PATCH] Fixed _models_ and _screens_ folders structure proper folders for models unified _screen_ folder filenames --- lib/application.dart | 6 ++-- .../{ev_source => models}/ev_source_type.dart | 0 lib/data/models/exposure_pair.dart | 4 +-- .../aperture_value.dart | 0 .../{ => photography_values}/iso_value.dart | 0 .../{ => photography_values}/nd_value.dart | 0 .../photography_value.dart | 0 .../shutter_speed_value.dart | 0 lib/data/shared_prefs_service.dart | 6 ++-- lib/l10n/intl_en.arb | 3 -- lib/main.dart | 2 +- lib/main_mock.dart | 2 +- lib/screens/metering/bloc_metering.dart | 6 ++-- .../shared/widget_circle_filled.dart} | 0 ...button.dart => widget_button_measure.dart} | 3 +- ...tons.dart => widget_button_secondary.dart} | 7 +++-- .../components/zoom_slider.dart | 25 ----------------- ...trols.dart => widget_bottom_controls.dart} | 8 +++--- ...t => widget_item_list_exposure_pairs.dart} | 6 ++-- ...t.dart => widget_list_exposure_pairs.dart} | 6 ++-- ...iner.dart => container_reading_value.dart} | 17 ++++++++--- ...ialog.dart => widget_dialog_animated.dart} | 0 ...review.dart => widget_camera_preview.dart} | 4 +-- ..._picker.dart => widget_dialog_picker.dart} | 2 +- .../topbar/models/reading_value.dart | 9 ------ .../{topbar.dart => widget_topbar.dart} | 23 ++++++++------- .../ev_source/camera/bloc_camera.dart | 2 +- .../ev_source/camera/event_camera.dart | 0 .../ev_source/camera/state_camera.dart | 0 .../metering}/ev_source/ev_source_bloc.dart | 0 .../ev_source/random_ev/bloc_random_ev.dart | 2 +- .../ev_source/random_ev/event_random_ev.dart | 0 .../ev_source/random_ev/state_random_ev.dart | 0 lib/screens/metering/event_metering.dart | 6 ++-- lib/screens/metering/flow_metering.dart | 13 +++++---- lib/screens/metering/screen_metering.dart | 10 +++---- lib/screens/metering/state_metering.dart | 4 +-- .../settings/components/caffeine_tile.dart | 28 ------------------- .../settings/components/haptics_tile.dart | 27 ------------------ ..._picker.dart => widget_dialog_picker.dart} | 0 ...n_label.dart => widget_label_version.dart} | 0 ...=> widget_list_tile_fractional_stops.dart} | 4 +-- ....dart => widget_list_tile_theme_type.dart} | 2 +- ...tings_screen.dart => screen_settings.dart} | 6 ++-- lib/utils/stop_type_provider.dart | 2 +- test/photograpy_values_test.dart | 8 +++--- 46 files changed, 86 insertions(+), 167 deletions(-) rename lib/data/{ev_source => models}/ev_source_type.dart (100%) rename lib/data/models/{ => photography_values}/aperture_value.dart (100%) rename lib/data/models/{ => photography_values}/iso_value.dart (100%) rename lib/data/models/{ => photography_values}/nd_value.dart (100%) rename lib/data/models/{ => photography_values}/photography_value.dart (100%) rename lib/data/models/{ => photography_values}/shutter_speed_value.dart (100%) rename lib/screens/metering/components/{shared/filled_circle.dart => bottom_controls/components/shared/widget_circle_filled.dart} (100%) rename lib/screens/metering/components/bottom_controls/components/{measure_button.dart => widget_button_measure.dart} (94%) rename lib/screens/metering/components/bottom_controls/components/{side_buttons.dart => widget_button_secondary.dart} (73%) delete mode 100644 lib/screens/metering/components/bottom_controls/components/zoom_slider.dart rename lib/screens/metering/components/bottom_controls/{bottom_controls.dart => widget_bottom_controls.dart} (88%) rename lib/screens/metering/components/exposure_pairs_list/components/{exposure_pair_item.dart => widget_item_list_exposure_pairs.dart} (85%) rename lib/screens/metering/components/exposure_pairs_list/{exposure_pairs_list.dart => widget_list_exposure_pairs.dart} (93%) rename lib/screens/metering/components/topbar/components/{reading_container.dart => container_reading_value.dart} (87%) rename lib/screens/metering/components/topbar/components/shared/{animated_dialog.dart => widget_dialog_animated.dart} (100%) rename lib/screens/metering/components/topbar/components/{camera_preview.dart => widget_camera_preview.dart} (92%) rename lib/screens/metering/components/topbar/components/{dialog_picker.dart => widget_dialog_picker.dart} (98%) delete mode 100644 lib/screens/metering/components/topbar/models/reading_value.dart rename lib/screens/metering/components/topbar/{topbar.dart => widget_topbar.dart} (90%) rename lib/{data => screens/metering}/ev_source/camera/bloc_camera.dart (98%) rename lib/{data => screens/metering}/ev_source/camera/event_camera.dart (100%) rename lib/{data => screens/metering}/ev_source/camera/state_camera.dart (100%) rename lib/{data => screens/metering}/ev_source/ev_source_bloc.dart (100%) rename lib/{data => screens/metering}/ev_source/random_ev/bloc_random_ev.dart (92%) rename lib/{data => screens/metering}/ev_source/random_ev/event_random_ev.dart (100%) rename lib/{data => screens/metering}/ev_source/random_ev/state_random_ev.dart (100%) delete mode 100644 lib/screens/settings/components/caffeine_tile.dart delete mode 100644 lib/screens/settings/components/haptics_tile.dart rename lib/screens/settings/components/shared/{dialog_picker.dart => widget_dialog_picker.dart} (100%) rename lib/screens/settings/components/{version_label.dart => widget_label_version.dart} (100%) rename lib/screens/settings/components/{fractional_stops_tile.dart => widget_list_tile_fractional_stops.dart} (91%) rename lib/screens/settings/components/{theme_type_tile.dart => widget_list_tile_theme_type.dart} (96%) rename lib/screens/settings/{settings_screen.dart => screen_settings.dart} (91%) diff --git a/lib/application.dart b/lib/application.dart index fd75a59..b53b1ee 100644 --- a/lib/application.dart +++ b/lib/application.dart @@ -1,16 +1,16 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:lightmeter/data/ev_source/ev_source_type.dart'; -import 'package:lightmeter/data/permissions_service.dart'; -import 'package:lightmeter/screens/settings/settings_screen.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'data/models/ev_source_type.dart'; +import 'data/permissions_service.dart'; import 'data/shared_prefs_service.dart'; import 'generated/l10n.dart'; import 'res/theme.dart'; import 'screens/metering/flow_metering.dart'; +import 'screens/settings/screen_settings.dart'; import 'utils/stop_type_provider.dart'; final RouteObserver routeObserver = RouteObserver(); diff --git a/lib/data/ev_source/ev_source_type.dart b/lib/data/models/ev_source_type.dart similarity index 100% rename from lib/data/ev_source/ev_source_type.dart rename to lib/data/models/ev_source_type.dart diff --git a/lib/data/models/exposure_pair.dart b/lib/data/models/exposure_pair.dart index 4fc6826..cea5a69 100644 --- a/lib/data/models/exposure_pair.dart +++ b/lib/data/models/exposure_pair.dart @@ -1,5 +1,5 @@ -import 'aperture_value.dart'; -import 'shutter_speed_value.dart'; +import 'photography_values/aperture_value.dart'; +import 'photography_values/shutter_speed_value.dart'; class ExposurePair { final ApertureValue aperture; diff --git a/lib/data/models/aperture_value.dart b/lib/data/models/photography_values/aperture_value.dart similarity index 100% rename from lib/data/models/aperture_value.dart rename to lib/data/models/photography_values/aperture_value.dart diff --git a/lib/data/models/iso_value.dart b/lib/data/models/photography_values/iso_value.dart similarity index 100% rename from lib/data/models/iso_value.dart rename to lib/data/models/photography_values/iso_value.dart diff --git a/lib/data/models/nd_value.dart b/lib/data/models/photography_values/nd_value.dart similarity index 100% rename from lib/data/models/nd_value.dart rename to lib/data/models/photography_values/nd_value.dart diff --git a/lib/data/models/photography_value.dart b/lib/data/models/photography_values/photography_value.dart similarity index 100% rename from lib/data/models/photography_value.dart rename to lib/data/models/photography_values/photography_value.dart diff --git a/lib/data/models/shutter_speed_value.dart b/lib/data/models/photography_values/shutter_speed_value.dart similarity index 100% rename from lib/data/models/shutter_speed_value.dart rename to lib/data/models/photography_values/shutter_speed_value.dart diff --git a/lib/data/shared_prefs_service.dart b/lib/data/shared_prefs_service.dart index b975b62..b456b0b 100644 --- a/lib/data/shared_prefs_service.dart +++ b/lib/data/shared_prefs_service.dart @@ -1,8 +1,8 @@ -import 'package:lightmeter/data/models/nd_value.dart'; -import 'package:lightmeter/data/models/theme_type.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'models/iso_value.dart'; +import 'models/photography_values/iso_value.dart'; +import 'models/photography_values/nd_value.dart'; +import 'models/theme_type.dart'; class UserPreferencesService { static const _isoKey = "ISO"; diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index d3adaae..3ac7b5a 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -17,9 +17,6 @@ "showFractionalStops": "Show fractional stops", "halfStops": "1/2", "thirdStops": "1/3", - "caffeine": "Caffeine", - "keepsScreenOn": "Keeps screen on", - "haptics": "Haptics", "theme": "Theme", "chooseTheme": "Choose theme", "themeLight": "Light", diff --git a/lib/main.dart b/lib/main.dart index 49a2651..72c51db 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/data/ev_source/ev_source_type.dart'; +import 'package:lightmeter/data/models/ev_source_type.dart'; import 'application.dart'; diff --git a/lib/main_mock.dart b/lib/main_mock.dart index 9c85198..d44956e 100644 --- a/lib/main_mock.dart +++ b/lib/main_mock.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/data/ev_source/ev_source_type.dart'; +import 'package:lightmeter/data/models/ev_source_type.dart'; import 'application.dart'; diff --git a/lib/screens/metering/bloc_metering.dart b/lib/screens/metering/bloc_metering.dart index c42b0a2..a15fc1a 100644 --- a/lib/screens/metering/bloc_metering.dart +++ b/lib/screens/metering/bloc_metering.dart @@ -2,10 +2,10 @@ import 'dart:async'; import 'dart:math'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lightmeter/data/models/aperture_value.dart'; +import 'package:lightmeter/data/models/photography_values/aperture_value.dart'; import 'package:lightmeter/data/models/exposure_pair.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; -import 'package:lightmeter/data/models/shutter_speed_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/shutter_speed_value.dart'; import 'package:lightmeter/data/shared_prefs_service.dart'; import 'package:lightmeter/screens/metering/communication/event_communication_metering.dart' as communication_events; import 'package:lightmeter/screens/metering/communication/state_communication_metering.dart' as communication_states; diff --git a/lib/screens/metering/components/shared/filled_circle.dart b/lib/screens/metering/components/bottom_controls/components/shared/widget_circle_filled.dart similarity index 100% rename from lib/screens/metering/components/shared/filled_circle.dart rename to lib/screens/metering/components/bottom_controls/components/shared/widget_circle_filled.dart diff --git a/lib/screens/metering/components/bottom_controls/components/measure_button.dart b/lib/screens/metering/components/bottom_controls/components/widget_button_measure.dart similarity index 94% rename from lib/screens/metering/components/bottom_controls/components/measure_button.dart rename to lib/screens/metering/components/bottom_controls/components/widget_button_measure.dart index 50bc4d4..77f0a13 100644 --- a/lib/screens/metering/components/bottom_controls/components/measure_button.dart +++ b/lib/screens/metering/components/bottom_controls/components/widget_button_measure.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'package:lightmeter/screens/metering/components/shared/filled_circle.dart'; + +import 'shared/widget_circle_filled.dart'; class MeteringMeasureButton extends StatefulWidget { final double size; diff --git a/lib/screens/metering/components/bottom_controls/components/side_buttons.dart b/lib/screens/metering/components/bottom_controls/components/widget_button_secondary.dart similarity index 73% rename from lib/screens/metering/components/bottom_controls/components/side_buttons.dart rename to lib/screens/metering/components/bottom_controls/components/widget_button_secondary.dart index 958498b..070d2de 100644 --- a/lib/screens/metering/components/bottom_controls/components/side_buttons.dart +++ b/lib/screens/metering/components/bottom_controls/components/widget_button_secondary.dart @@ -1,11 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/screens/metering/components/shared/filled_circle.dart'; -class MeteringBottomControlsSideButton extends StatelessWidget { +import 'shared/widget_circle_filled.dart'; + +class MeteringSecondaryButton extends StatelessWidget { final IconData icon; final VoidCallback onPressed; - const MeteringBottomControlsSideButton({ + const MeteringSecondaryButton({ required this.icon, required this.onPressed, super.key, diff --git a/lib/screens/metering/components/bottom_controls/components/zoom_slider.dart b/lib/screens/metering/components/bottom_controls/components/zoom_slider.dart deleted file mode 100644 index 9de55c7..0000000 --- a/lib/screens/metering/components/bottom_controls/components/zoom_slider.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:lightmeter/res/dimens.dart'; - -class ZoomSlider extends StatelessWidget { - const ZoomSlider({super.key}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingL), - child: Row( - children: [ - const Icon(Icons.zoom_out), - Expanded( - child: Slider( - value: 0, - onChanged: (value) {}, - ), - ), - const Icon(Icons.zoom_in), - ], - ), - ); - } -} diff --git a/lib/screens/metering/components/bottom_controls/bottom_controls.dart b/lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart similarity index 88% rename from lib/screens/metering/components/bottom_controls/bottom_controls.dart rename to lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart index a6eb370..1eeb1c7 100644 --- a/lib/screens/metering/components/bottom_controls/bottom_controls.dart +++ b/lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'components/measure_button.dart'; -import 'components/side_buttons.dart'; +import 'components/widget_button_measure.dart'; +import 'components/widget_button_secondary.dart'; class MeteringBottomControls extends StatelessWidget { final VoidCallback onSourceChanged; @@ -32,14 +32,14 @@ class MeteringBottomControls extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - MeteringBottomControlsSideButton( + MeteringSecondaryButton( onPressed: onSourceChanged, icon: Icons.flip_camera_android, ), MeteringMeasureButton( onTap: onMeasure, ), - MeteringBottomControlsSideButton( + MeteringSecondaryButton( onPressed: onSettings, icon: Icons.settings, ), diff --git a/lib/screens/metering/components/exposure_pairs_list/components/exposure_pair_item.dart b/lib/screens/metering/components/exposure_pairs_list/components/widget_item_list_exposure_pairs.dart similarity index 85% rename from lib/screens/metering/components/exposure_pairs_list/components/exposure_pair_item.dart rename to lib/screens/metering/components/exposure_pairs_list/components/widget_item_list_exposure_pairs.dart index b640e55..c5fbc0d 100644 --- a/lib/screens/metering/components/exposure_pairs_list/components/exposure_pair_item.dart +++ b/lib/screens/metering/components/exposure_pairs_list/components/widget_item_list_exposure_pairs.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:lightmeter/res/dimens.dart'; -class ExposurePaitListItem extends StatelessWidget { +class ExposurePairsListItem extends StatelessWidget { final T value; final bool tickOnTheLeft; - const ExposurePaitListItem(this.value, {required this.tickOnTheLeft, super.key}); + const ExposurePairsListItem(this.value, {required this.tickOnTheLeft, super.key}); @override Widget build(BuildContext context) { diff --git a/lib/screens/metering/components/exposure_pairs_list/exposure_pairs_list.dart b/lib/screens/metering/components/exposure_pairs_list/widget_list_exposure_pairs.dart similarity index 93% rename from lib/screens/metering/components/exposure_pairs_list/exposure_pairs_list.dart rename to lib/screens/metering/components/exposure_pairs_list/widget_list_exposure_pairs.dart index 1583ca8..91dc2d6 100644 --- a/lib/screens/metering/components/exposure_pairs_list/exposure_pairs_list.dart +++ b/lib/screens/metering/components/exposure_pairs_list/widget_list_exposure_pairs.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/data/models/exposure_pair.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'package:lightmeter/screens/metering/components/exposure_pairs_list/components/exposure_pair_item.dart'; +import 'package:lightmeter/screens/metering/components/exposure_pairs_list/components/widget_item_list_exposure_pairs.dart'; class ExposurePairsList extends StatelessWidget { final List exposurePairs; @@ -27,7 +27,7 @@ class ExposurePairsList extends StatelessWidget { Expanded( child: Align( alignment: Alignment.centerLeft, - child: ExposurePaitListItem( + child: ExposurePairsListItem( exposurePairs[index].aperture, tickOnTheLeft: false, ), @@ -36,7 +36,7 @@ class ExposurePairsList extends StatelessWidget { Expanded( child: Align( alignment: Alignment.centerLeft, - child: ExposurePaitListItem( + child: ExposurePairsListItem( exposurePairs[index].shutterSpeed, tickOnTheLeft: true, ), diff --git a/lib/screens/metering/components/topbar/components/reading_container.dart b/lib/screens/metering/components/topbar/components/container_reading_value.dart similarity index 87% rename from lib/screens/metering/components/topbar/components/reading_container.dart rename to lib/screens/metering/components/topbar/components/container_reading_value.dart index 13c1734..e61460f 100644 --- a/lib/screens/metering/components/topbar/components/reading_container.dart +++ b/lib/screens/metering/components/topbar/components/container_reading_value.dart @@ -1,11 +1,20 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'package:lightmeter/screens/metering/components/topbar/models/reading_value.dart'; -class ReadingContainer extends StatelessWidget { +class ReadingValue { + final String label; + final String value; + + const ReadingValue({ + required this.label, + required this.value, + }); +} + +class ReadingValueContainer extends StatelessWidget { late final List _items; - ReadingContainer({ + ReadingValueContainer({ required List values, super.key, }) { @@ -18,7 +27,7 @@ class ReadingContainer extends StatelessWidget { } } - ReadingContainer.singleValue({ + ReadingValueContainer.singleValue({ required ReadingValue value, super.key, }) : _items = [_ReadingValueBuilder(value)]; diff --git a/lib/screens/metering/components/topbar/components/shared/animated_dialog.dart b/lib/screens/metering/components/topbar/components/shared/widget_dialog_animated.dart similarity index 100% rename from lib/screens/metering/components/topbar/components/shared/animated_dialog.dart rename to lib/screens/metering/components/topbar/components/shared/widget_dialog_animated.dart diff --git a/lib/screens/metering/components/topbar/components/camera_preview.dart b/lib/screens/metering/components/topbar/components/widget_camera_preview.dart similarity index 92% rename from lib/screens/metering/components/topbar/components/camera_preview.dart rename to lib/screens/metering/components/topbar/components/widget_camera_preview.dart index c2a88e0..8074c3b 100644 --- a/lib/screens/metering/components/topbar/components/camera_preview.dart +++ b/lib/screens/metering/components/topbar/components/widget_camera_preview.dart @@ -2,8 +2,8 @@ import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lightmeter/data/ev_source/camera/bloc_camera.dart'; -import 'package:lightmeter/data/ev_source/camera/state_camera.dart'; +import 'package:lightmeter/screens/metering/ev_source/camera/bloc_camera.dart'; +import 'package:lightmeter/screens/metering/ev_source/camera/state_camera.dart'; class CameraView extends StatelessWidget { const CameraView({Key? key}) : super(key: key); diff --git a/lib/screens/metering/components/topbar/components/dialog_picker.dart b/lib/screens/metering/components/topbar/components/widget_dialog_picker.dart similarity index 98% rename from lib/screens/metering/components/topbar/components/dialog_picker.dart rename to lib/screens/metering/components/topbar/components/widget_dialog_picker.dart index 6f80e60..1ba1f08 100644 --- a/lib/screens/metering/components/topbar/components/dialog_picker.dart +++ b/lib/screens/metering/components/topbar/components/widget_dialog_picker.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/generated/l10n.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:lightmeter/res/dimens.dart'; typedef DialogPickerItemBuilder = Widget Function(BuildContext, T); diff --git a/lib/screens/metering/components/topbar/models/reading_value.dart b/lib/screens/metering/components/topbar/models/reading_value.dart deleted file mode 100644 index be0f3bf..0000000 --- a/lib/screens/metering/components/topbar/models/reading_value.dart +++ /dev/null @@ -1,9 +0,0 @@ -class ReadingValue { - final String label; - final String value; - - const ReadingValue({ - required this.label, - required this.value, - }); -} diff --git a/lib/screens/metering/components/topbar/topbar.dart b/lib/screens/metering/components/topbar/widget_topbar.dart similarity index 90% rename from lib/screens/metering/components/topbar/topbar.dart rename to lib/screens/metering/components/topbar/widget_topbar.dart index 506dd08..2a8ca34 100644 --- a/lib/screens/metering/components/topbar/topbar.dart +++ b/lib/screens/metering/components/topbar/widget_topbar.dart @@ -1,18 +1,17 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lightmeter/data/ev_source/camera/bloc_camera.dart'; +import 'package:lightmeter/screens/metering/ev_source/camera/bloc_camera.dart'; import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/data/models/exposure_pair.dart'; -import 'package:lightmeter/data/models/iso_value.dart'; -import 'package:lightmeter/data/models/nd_value.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/iso_value.dart'; +import 'package:lightmeter/data/models/photography_values/nd_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'components/camera_preview.dart'; -import 'components/shared/animated_dialog.dart'; -import 'components/dialog_picker.dart'; -import 'components/reading_container.dart'; -import 'models/reading_value.dart'; +import 'components/widget_camera_preview.dart'; +import 'components/shared/widget_dialog_animated.dart'; +import 'components/widget_dialog_picker.dart'; +import 'components/container_reading_value.dart'; class MeteringTopBar extends StatelessWidget { final ExposurePair? fastest; @@ -57,7 +56,7 @@ class MeteringTopBar extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - ReadingContainer( + ReadingValueContainer( values: [ ReadingValue( label: S.of(context).fastestExposurePair, @@ -75,7 +74,7 @@ class MeteringTopBar extends StatelessWidget { ), /* const _InnerPadding(), - ReadingContainer.singleValue( + ReadingValueContainer.singleValue( value: ReadingValue( label: 'EV', value: ev.toStringAsFixed(1), @@ -168,7 +167,7 @@ class _AnimatedDialogPicker extends StatelessWidget Widget build(BuildContext context) { return AnimatedDialog( key: _key, - closedChild: ReadingContainer.singleValue( + closedChild: ReadingValueContainer.singleValue( value: ReadingValue( label: title, value: selectedValue.value.toString(), diff --git a/lib/data/ev_source/camera/bloc_camera.dart b/lib/screens/metering/ev_source/camera/bloc_camera.dart similarity index 98% rename from lib/data/ev_source/camera/bloc_camera.dart rename to lib/screens/metering/ev_source/camera/bloc_camera.dart index fe2dd81..b68a00c 100644 --- a/lib/data/ev_source/camera/bloc_camera.dart +++ b/lib/screens/metering/ev_source/camera/bloc_camera.dart @@ -6,7 +6,7 @@ import 'package:camera/camera.dart'; import 'package:exif/exif.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lightmeter/data/ev_source/ev_source_bloc.dart'; +import 'package:lightmeter/screens/metering/ev_source/ev_source_bloc.dart'; import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart'; import 'package:lightmeter/screens/metering/communication/event_communication_metering.dart' as communication_event; import 'package:lightmeter/screens/metering/communication/state_communication_metering.dart' as communication_states; diff --git a/lib/data/ev_source/camera/event_camera.dart b/lib/screens/metering/ev_source/camera/event_camera.dart similarity index 100% rename from lib/data/ev_source/camera/event_camera.dart rename to lib/screens/metering/ev_source/camera/event_camera.dart diff --git a/lib/data/ev_source/camera/state_camera.dart b/lib/screens/metering/ev_source/camera/state_camera.dart similarity index 100% rename from lib/data/ev_source/camera/state_camera.dart rename to lib/screens/metering/ev_source/camera/state_camera.dart diff --git a/lib/data/ev_source/ev_source_bloc.dart b/lib/screens/metering/ev_source/ev_source_bloc.dart similarity index 100% rename from lib/data/ev_source/ev_source_bloc.dart rename to lib/screens/metering/ev_source/ev_source_bloc.dart diff --git a/lib/data/ev_source/random_ev/bloc_random_ev.dart b/lib/screens/metering/ev_source/random_ev/bloc_random_ev.dart similarity index 92% rename from lib/data/ev_source/random_ev/bloc_random_ev.dart rename to lib/screens/metering/ev_source/random_ev/bloc_random_ev.dart index cc26b9b..17103ee 100644 --- a/lib/data/ev_source/random_ev/bloc_random_ev.dart +++ b/lib/screens/metering/ev_source/random_ev/bloc_random_ev.dart @@ -1,5 +1,5 @@ import 'dart:math'; -import 'package:lightmeter/data/ev_source/ev_source_bloc.dart'; +import 'package:lightmeter/screens/metering/ev_source/ev_source_bloc.dart'; import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart'; import 'package:lightmeter/screens/metering/communication/event_communication_metering.dart' as communication_event; import 'package:lightmeter/screens/metering/communication/state_communication_metering.dart' as communication_states; diff --git a/lib/data/ev_source/random_ev/event_random_ev.dart b/lib/screens/metering/ev_source/random_ev/event_random_ev.dart similarity index 100% rename from lib/data/ev_source/random_ev/event_random_ev.dart rename to lib/screens/metering/ev_source/random_ev/event_random_ev.dart diff --git a/lib/data/ev_source/random_ev/state_random_ev.dart b/lib/screens/metering/ev_source/random_ev/state_random_ev.dart similarity index 100% rename from lib/data/ev_source/random_ev/state_random_ev.dart rename to lib/screens/metering/ev_source/random_ev/state_random_ev.dart diff --git a/lib/screens/metering/event_metering.dart b/lib/screens/metering/event_metering.dart index 302aff2..f1fd5c4 100644 --- a/lib/screens/metering/event_metering.dart +++ b/lib/screens/metering/event_metering.dart @@ -1,6 +1,6 @@ -import 'package:lightmeter/data/models/iso_value.dart'; -import 'package:lightmeter/data/models/nd_value.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/iso_value.dart'; +import 'package:lightmeter/data/models/photography_values/nd_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; abstract class MeteringEvent { const MeteringEvent(); diff --git a/lib/screens/metering/flow_metering.dart b/lib/screens/metering/flow_metering.dart index 6274c10..83d53e5 100644 --- a/lib/screens/metering/flow_metering.dart +++ b/lib/screens/metering/flow_metering.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lightmeter/data/ev_source/camera/bloc_camera.dart'; -import 'package:lightmeter/data/ev_source/ev_source_type.dart'; -import 'package:lightmeter/data/ev_source/random_ev/bloc_random_ev.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/ev_source_type.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:lightmeter/data/shared_prefs_service.dart'; -import 'package:lightmeter/screens/metering/bloc_metering.dart'; -import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart'; + +import 'ev_source/camera/bloc_camera.dart'; +import 'ev_source/random_ev/bloc_random_ev.dart'; +import 'bloc_metering.dart'; +import 'communication/bloc_communication_metering.dart'; import 'screen_metering.dart'; diff --git a/lib/screens/metering/screen_metering.dart b/lib/screens/metering/screen_metering.dart index 9dc44a6..c113a4d 100644 --- a/lib/screens/metering/screen_metering.dart +++ b/lib/screens/metering/screen_metering.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'package:lightmeter/screens/settings/settings_screen.dart'; +import 'package:lightmeter/screens/settings/screen_settings.dart'; -import 'components/bottom_controls/bottom_controls.dart'; -import 'components/exposure_pairs_list/exposure_pairs_list.dart'; -import 'components/topbar/topbar.dart'; +import 'components/bottom_controls/widget_bottom_controls.dart'; +import 'components/exposure_pairs_list/widget_list_exposure_pairs.dart'; +import 'components/topbar/widget_topbar.dart'; import 'bloc_metering.dart'; import 'event_metering.dart'; import 'state_metering.dart'; diff --git a/lib/screens/metering/state_metering.dart b/lib/screens/metering/state_metering.dart index b18016c..3110fd3 100644 --- a/lib/screens/metering/state_metering.dart +++ b/lib/screens/metering/state_metering.dart @@ -1,6 +1,6 @@ import 'package:lightmeter/data/models/exposure_pair.dart'; -import 'package:lightmeter/data/models/iso_value.dart'; -import 'package:lightmeter/data/models/nd_value.dart'; +import 'package:lightmeter/data/models/photography_values/iso_value.dart'; +import 'package:lightmeter/data/models/photography_values/nd_value.dart'; class MeteringState { final double ev; diff --git a/lib/screens/settings/components/caffeine_tile.dart b/lib/screens/settings/components/caffeine_tile.dart deleted file mode 100644 index 201d192..0000000 --- a/lib/screens/settings/components/caffeine_tile.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:lightmeter/generated/l10n.dart'; - -class CaffeineListTile extends StatefulWidget { - const CaffeineListTile({super.key}); - - @override - State createState() => _CaffeineListTileState(); -} - -class _CaffeineListTileState extends State { - bool _isCaffeineOn = false; - - @override - Widget build(BuildContext context) { - return SwitchListTile( - secondary: const Icon(Icons.coffee), - title: Text(S.of(context).caffeine), - subtitle: Text(S.of(context).keepsScreenOn), - value: _isCaffeineOn, - onChanged: (value) { - setState(() { - _isCaffeineOn = value; - }); - }, - ); - } -} diff --git a/lib/screens/settings/components/haptics_tile.dart b/lib/screens/settings/components/haptics_tile.dart deleted file mode 100644 index 88ec1d0..0000000 --- a/lib/screens/settings/components/haptics_tile.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:lightmeter/generated/l10n.dart'; - -class HapticsListTile extends StatefulWidget { - const HapticsListTile({super.key}); - - @override - State createState() => _HapticsListTileState(); -} - -class _HapticsListTileState extends State { - bool _value = false; - - @override - Widget build(BuildContext context) { - return SwitchListTile( - secondary: const Icon(Icons.vibration), - title: Text(S.of(context).haptics), - value: _value, - onChanged: (value) { - setState(() { - _value = value; - }); - }, - ); - } -} diff --git a/lib/screens/settings/components/shared/dialog_picker.dart b/lib/screens/settings/components/shared/widget_dialog_picker.dart similarity index 100% rename from lib/screens/settings/components/shared/dialog_picker.dart rename to lib/screens/settings/components/shared/widget_dialog_picker.dart diff --git a/lib/screens/settings/components/version_label.dart b/lib/screens/settings/components/widget_label_version.dart similarity index 100% rename from lib/screens/settings/components/version_label.dart rename to lib/screens/settings/components/widget_label_version.dart diff --git a/lib/screens/settings/components/fractional_stops_tile.dart b/lib/screens/settings/components/widget_list_tile_fractional_stops.dart similarity index 91% rename from lib/screens/settings/components/fractional_stops_tile.dart rename to lib/screens/settings/components/widget_list_tile_fractional_stops.dart index 1c6ed74..80c35ad 100644 --- a/lib/screens/settings/components/fractional_stops_tile.dart +++ b/lib/screens/settings/components/widget_list_tile_fractional_stops.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/utils/stop_type_provider.dart'; import 'package:provider/provider.dart'; -import 'shared/dialog_picker.dart'; +import 'shared/widget_dialog_picker.dart'; class StopTypeListTile extends StatelessWidget { const StopTypeListTile({super.key}); diff --git a/lib/screens/settings/components/theme_type_tile.dart b/lib/screens/settings/components/widget_list_tile_theme_type.dart similarity index 96% rename from lib/screens/settings/components/theme_type_tile.dart rename to lib/screens/settings/components/widget_list_tile_theme_type.dart index 94ba115..34f4e43 100644 --- a/lib/screens/settings/components/theme_type_tile.dart +++ b/lib/screens/settings/components/widget_list_tile_theme_type.dart @@ -4,7 +4,7 @@ import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/theme.dart'; import 'package:provider/provider.dart'; -import 'shared/dialog_picker.dart'; +import 'shared/widget_dialog_picker.dart'; class ThemeTypeListTile extends StatelessWidget { const ThemeTypeListTile({super.key}); diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/screen_settings.dart similarity index 91% rename from lib/screens/settings/settings_screen.dart rename to lib/screens/settings/screen_settings.dart index 579524f..59e0a77 100644 --- a/lib/screens/settings/settings_screen.dart +++ b/lib/screens/settings/screen_settings.dart @@ -2,9 +2,9 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'components/fractional_stops_tile.dart'; -import 'components/theme_type_tile.dart'; -import 'components/version_label.dart'; +import 'components/widget_list_tile_fractional_stops.dart'; +import 'components/widget_list_tile_theme_type.dart'; +import 'components/widget_label_version.dart'; class SettingsScreen extends StatelessWidget { const SettingsScreen({super.key}); diff --git a/lib/utils/stop_type_provider.dart b/lib/utils/stop_type_provider.dart index 8a6b619..caff28e 100644 --- a/lib/utils/stop_type_provider.dart +++ b/lib/utils/stop_type_provider.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; import 'package:provider/provider.dart'; class StopTypeProvider extends StatefulWidget { diff --git a/test/photograpy_values_test.dart b/test/photograpy_values_test.dart index b3bd4eb..106754b 100644 --- a/test/photograpy_values_test.dart +++ b/test/photograpy_values_test.dart @@ -1,7 +1,7 @@ -import 'package:lightmeter/data/models/aperture_value.dart'; -import 'package:lightmeter/data/models/iso_value.dart'; -import 'package:lightmeter/data/models/photography_value.dart'; -import 'package:lightmeter/data/models/shutter_speed_value.dart'; +import 'package:lightmeter/data/models/photography_values/aperture_value.dart'; +import 'package:lightmeter/data/models/photography_values/iso_value.dart'; +import 'package:lightmeter/data/models/photography_values/photography_value.dart'; +import 'package:lightmeter/data/models/photography_values/shutter_speed_value.dart'; import 'package:test/test.dart'; void main() {