From 74b1aed2842a9e85edb4152fcd48d44fe743e3bb Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Mon, 21 Jul 2025 21:56:50 +0200 Subject: [PATCH] aligned iap stub with iap release --- iap/lib/m3_lightmeter_iap.dart | 2 -- .../src/data/equipment_profile_service.dart | 30 ------------------- .../equipment_profiles_storage_service.dart | 26 ++++++++++++++++ iap/lib/src/data/films_storage_service.dart | 16 +++------- iap/lib/src/data/iap_storage_service.dart | 19 +++++++----- .../data/logbook_photos_storage_service.dart | 19 ++++++++++++ iap/lib/src/data/logbook_storage_service.dart | 24 --------------- iap/pubspec.yaml | 7 +---- 8 files changed, 62 insertions(+), 81 deletions(-) delete mode 100644 iap/lib/src/data/equipment_profile_service.dart create mode 100644 iap/lib/src/data/equipment_profiles_storage_service.dart create mode 100644 iap/lib/src/data/logbook_photos_storage_service.dart delete mode 100644 iap/lib/src/data/logbook_storage_service.dart diff --git a/iap/lib/m3_lightmeter_iap.dart b/iap/lib/m3_lightmeter_iap.dart index 7814253..43e69aa 100644 --- a/iap/lib/m3_lightmeter_iap.dart +++ b/iap/lib/m3_lightmeter_iap.dart @@ -4,8 +4,6 @@ import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; export 'src/data/models/iap_product.dart'; export 'src/providers/iap_products_provider.dart'; -export 'src/data/equipment_profile_service.dart'; -export 'src/data/films_storage_service.dart'; export 'src/data/iap_storage_service.dart'; const List films = []; diff --git a/iap/lib/src/data/equipment_profile_service.dart b/iap/lib/src/data/equipment_profile_service.dart deleted file mode 100644 index 019f9a8..0000000 --- a/iap/lib/src/data/equipment_profile_service.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'dart:async'; - -import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; - -class EquipmentProfilesStorageService { - EquipmentProfilesStorageService(); - - Future init() async {} - - String get selectedEquipmentProfileId => ''; - set selectedEquipmentProfileId(String id) {} - - Future addProfile(EquipmentProfile profile) async {} - - Future updateProfile({ - required String id, - String? name, - List? isoValues, - List? ndValues, - List? apertureValues, - List? shutterSpeedValues, - double? lensZoom, - double? exposureOffset, - bool? isUsed, - }) async {} - - Future deleteProfile(String id) async {} - - Future> getProfiles() async => {}; -} diff --git a/iap/lib/src/data/equipment_profiles_storage_service.dart b/iap/lib/src/data/equipment_profiles_storage_service.dart new file mode 100644 index 0000000..7394fda --- /dev/null +++ b/iap/lib/src/data/equipment_profiles_storage_service.dart @@ -0,0 +1,26 @@ +part of 'package:m3_lightmeter_iap/src/data/iap_storage_service.dart'; + +mixin EquipmentProfilesStorageService on IapStorageServiceBase { + static const String selectedEquipmentProfileIdKey = "selectedEquipmentProfileId"; + + String get selectedEquipmentProfileId => ''; + set selectedEquipmentProfileId(String id) {} + + Future addEquipmentProfile(EquipmentProfile profile) async {} + + Future updateEquipmentProfile({ + required String id, + String? name, + List? isoValues, + List? ndValues, + List? apertureValues, + List? shutterSpeedValues, + double? lensZoom, + double? exposureOffset, + bool? isUsed, + }) async {} + + Future deleteEquipmentProfile(String id) async {} + + Future> getEquipmentProfiles() async => {}; +} diff --git a/iap/lib/src/data/films_storage_service.dart b/iap/lib/src/data/films_storage_service.dart index 105afd6..5e0f50d 100644 --- a/iap/lib/src/data/films_storage_service.dart +++ b/iap/lib/src/data/films_storage_service.dart @@ -1,10 +1,6 @@ -import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; - -class FilmsStorageService { - FilmsStorageService(); - - Future init() async {} +part of 'package:m3_lightmeter_iap/src/data/iap_storage_service.dart'; +mixin FilmsStorageService on IapStorageServiceBase { String get selectedFilmId => ''; set selectedFilmId(String id) {} @@ -16,11 +12,7 @@ class FilmsStorageService { Future deleteFilm(FilmExponential _) async {} - Future> getPredefinedFilms() async { - return const {}; - } + Future> getPredefinedFilms() async => {}; - Future> getCustomFilms() async { - return const {}; - } + Future> getCustomFilms() async => {}; } diff --git a/iap/lib/src/data/iap_storage_service.dart b/iap/lib/src/data/iap_storage_service.dart index 14eaa4b..87a708c 100644 --- a/iap/lib/src/data/iap_storage_service.dart +++ b/iap/lib/src/data/iap_storage_service.dart @@ -1,11 +1,16 @@ import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; -class IAPStorageService { - const IAPStorageService(Object _); +part 'equipment_profiles_storage_service.dart'; +part 'films_storage_service.dart'; +part 'logbook_photos_storage_service.dart'; - String get selectedEquipmentProfileId => ''; - set selectedEquipmentProfileId(String id) {} - - List get equipmentProfiles => []; - set equipmentProfiles(List profiles) {} +class IapStorageService extends IapStorageServiceBase + with EquipmentProfilesStorageService, FilmsStorageService, LogbookPhotosStorageService { + IapStorageService(); // coverage:ignore-line +} + +abstract class IapStorageServiceBase { + IapStorageServiceBase(); + + Future init() async {} } diff --git a/iap/lib/src/data/logbook_photos_storage_service.dart b/iap/lib/src/data/logbook_photos_storage_service.dart new file mode 100644 index 0000000..da08170 --- /dev/null +++ b/iap/lib/src/data/logbook_photos_storage_service.dart @@ -0,0 +1,19 @@ +part of 'package:m3_lightmeter_iap/src/data/iap_storage_service.dart'; + +mixin LogbookPhotosStorageService on IapStorageServiceBase { + bool get saveLogbookPhotos => false; + set saveLogbookPhotos(bool value) {} + + Future addPhoto(LogbookPhoto profile) async {} + + Future updatePhoto({ + required String id, + String? note, + Optional? apertureValue, + Optional? shutterSpeedValue, + }) async {} + + Future deletePhoto(String id) async {} + + Future> getPhotos() async => []; +} diff --git a/iap/lib/src/data/logbook_storage_service.dart b/iap/lib/src/data/logbook_storage_service.dart deleted file mode 100644 index 807df29..0000000 --- a/iap/lib/src/data/logbook_storage_service.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'dart:async'; - -import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; - -class LogbookPhotosStorageService { - LogbookPhotosStorageService(); - - Future init() async {} - - Future addPhoto(LogbookPhoto profile) async {} - - Future updatePhoto({ - required String id, - String? note, - ApertureValue? apertureValue, - bool removeApertureValue = false, - ShutterSpeedValue? shutterSpeedValue, - bool removeShutterSpeedValue = false, - }) async {} - - Future deletePhoto(String id) async {} - - Future> getPhotos() async => []; -} diff --git a/iap/pubspec.yaml b/iap/pubspec.yaml index 542fcb6..98e25f2 100644 --- a/iap/pubspec.yaml +++ b/iap/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: m3_lightmeter_resources: git: url: "https://github.com/vodemn/m3_lightmeter_resources" - ref: v2.2.0 + ref: v2.3.0 shared_preferences: dev_dependencies: @@ -20,10 +20,5 @@ dev_dependencies: sdk: flutter flutter_lints: ^2.0.0 - -dependency_overrides: - m3_lightmeter_resources: - path: /Users/vodemn/Documents/GitHub/Vodemn/m3_lightmeter_resources - flutter: uses-material-design: true