From 6507df2ad6bea9e600c92bec4ab65a91c662d78c Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Wed, 1 Nov 2023 21:10:27 +0100 Subject: [PATCH] typo --- lib/providers/equipment_profile_provider.dart | 15 +++++++-------- lib/screens/metering/screen_metering.dart | 2 +- ...iles.dart => listener_equipment_profiles.dart} | 0 .../screen_equipment_profile.dart | 2 +- .../equipment_profile_provider_test.dart | 2 +- ...dart => listener_equipment_profiles_test.dart} | 6 +++--- 6 files changed, 13 insertions(+), 14 deletions(-) rename lib/screens/metering/utils/{listsner_equipment_profiles.dart => listener_equipment_profiles.dart} (100%) rename test/screens/metering/utils/{listsner_equipment_profiles_test.dart => listener_equipment_profiles_test.dart} (95%) diff --git a/lib/providers/equipment_profile_provider.dart b/lib/providers/equipment_profile_provider.dart index a5e0999..564c5ef 100644 --- a/lib/providers/equipment_profile_provider.dart +++ b/lib/providers/equipment_profile_provider.dart @@ -54,9 +54,7 @@ class EquipmentProfileProviderState extends State { _defaultProfile, if (IAPProducts.isPurchased(context, IAPProductType.paidFeatures)) ..._customProfiles, ], - selected: IAPProducts.isPurchased(context, IAPProductType.paidFeatures) - ? _selectedProfile - : _defaultProfile, + selected: IAPProducts.isPurchased(context, IAPProductType.paidFeatures) ? _selectedProfile : _defaultProfile, child: widget.child, ); } @@ -85,7 +83,7 @@ class EquipmentProfileProviderState extends State { _refreshSavedProfiles(); } - void updateProdile(EquipmentProfile data) { + void updateProfile(EquipmentProfile data) { final indexToUpdate = _customProfiles.indexWhere((element) => element.id == data.id); if (indexToUpdate >= 0) { _customProfiles[indexToUpdate] = data; @@ -118,13 +116,14 @@ class EquipmentProfiles extends SelectableInheritedModel { /// [_defaultProfile] + profiles created by the user static List of(BuildContext context) { - return InheritedModel.inheritFrom(context, aspect: SelectableAspect.list)! - .values; + return InheritedModel.inheritFrom(context, aspect: SelectableAspect.list)!.values; } static EquipmentProfile selectedOf(BuildContext context) { - return InheritedModel.inheritFrom(context, - aspect: SelectableAspect.selected,)! + return InheritedModel.inheritFrom( + context, + aspect: SelectableAspect.selected, + )! .selected; } } diff --git a/lib/screens/metering/screen_metering.dart b/lib/screens/metering/screen_metering.dart index 6900159..380411f 100644 --- a/lib/screens/metering/screen_metering.dart +++ b/lib/screens/metering/screen_metering.dart @@ -13,7 +13,7 @@ import 'package:lightmeter/screens/metering/components/camera_container/provider import 'package:lightmeter/screens/metering/components/light_sensor_container/provider_container_light_sensor.dart'; import 'package:lightmeter/screens/metering/event_metering.dart'; import 'package:lightmeter/screens/metering/state_metering.dart'; -import 'package:lightmeter/screens/metering/utils/listsner_equipment_profiles.dart'; +import 'package:lightmeter/screens/metering/utils/listener_equipment_profiles.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; class MeteringScreen extends StatelessWidget { diff --git a/lib/screens/metering/utils/listsner_equipment_profiles.dart b/lib/screens/metering/utils/listener_equipment_profiles.dart similarity index 100% rename from lib/screens/metering/utils/listsner_equipment_profiles.dart rename to lib/screens/metering/utils/listener_equipment_profiles.dart diff --git a/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart b/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart index b10190f..6879a2c 100644 --- a/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart +++ b/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart @@ -90,7 +90,7 @@ class _EquipmentProfilesScreenState extends State { } void _updateProfileAt(EquipmentProfile data) { - EquipmentProfileProvider.of(context).updateProdile(data); + EquipmentProfileProvider.of(context).updateProfile(data); } void _removeProfileAt(EquipmentProfile data) { diff --git a/test/providers/equipment_profile_provider_test.dart b/test/providers/equipment_profile_provider_test.dart index 83f04f7..fb329cd 100644 --- a/test/providers/equipment_profile_provider_test.dart +++ b/test/providers/equipment_profile_provider_test.dart @@ -260,7 +260,7 @@ class _Application extends StatelessWidget { ElevatedButton( key: updateProfileButtonKey(profile.id), onPressed: () { - EquipmentProfileProvider.of(context).updateProdile( + EquipmentProfileProvider.of(context).updateProfile( profile.copyWith( name: '${profile.name} updated', isoValues: _customProfiles.first.isoValues, diff --git a/test/screens/metering/utils/listsner_equipment_profiles_test.dart b/test/screens/metering/utils/listener_equipment_profiles_test.dart similarity index 95% rename from test/screens/metering/utils/listsner_equipment_profiles_test.dart rename to test/screens/metering/utils/listener_equipment_profiles_test.dart index f1c11aa..c3020bf 100644 --- a/test/screens/metering/utils/listsner_equipment_profiles_test.dart +++ b/test/screens/metering/utils/listener_equipment_profiles_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:lightmeter/providers/equipment_profile_provider.dart'; -import 'package:lightmeter/screens/metering/utils/listsner_equipment_profiles.dart'; +import 'package:lightmeter/screens/metering/utils/listener_equipment_profiles.dart'; import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; import 'package:mocktail/mocktail.dart'; @@ -65,13 +65,13 @@ void main() { /// Verify that updating the current profile triggers the callback final updatedProfile1 = _customProfiles[0].copyWith(name: 'Test 1 updated'); - equipmentProfileProviderKey.currentState!.updateProdile(updatedProfile1); + equipmentProfileProviderKey.currentState!.updateProfile(updatedProfile1); await tester.pump(); verify(() => onDidChangeDependencies.onChanged(updatedProfile1)).called(1); /// Verify that updating the not selected profile doesn't trigger the callback final updatedProfile2 = _customProfiles[1].copyWith(name: 'Test 2 updated'); - equipmentProfileProviderKey.currentState!.updateProdile(updatedProfile2); + equipmentProfileProviderKey.currentState!.updateProfile(updatedProfile2); await tester.pump(); verifyNever(() => onDidChangeDependencies.onChanged(updatedProfile2)); },