mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 17:00:39 +00:00
typo
This commit is contained in:
parent
d26da843b3
commit
6507df2ad6
6 changed files with 13 additions and 14 deletions
|
@ -54,9 +54,7 @@ class EquipmentProfileProviderState extends State<EquipmentProfileProvider> {
|
|||
_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<EquipmentProfileProvider> {
|
|||
_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<EquipmentProfile> {
|
|||
|
||||
/// [_defaultProfile] + profiles created by the user
|
||||
static List<EquipmentProfile> of(BuildContext context) {
|
||||
return InheritedModel.inheritFrom<EquipmentProfiles>(context, aspect: SelectableAspect.list)!
|
||||
.values;
|
||||
return InheritedModel.inheritFrom<EquipmentProfiles>(context, aspect: SelectableAspect.list)!.values;
|
||||
}
|
||||
|
||||
static EquipmentProfile selectedOf(BuildContext context) {
|
||||
return InheritedModel.inheritFrom<EquipmentProfiles>(context,
|
||||
aspect: SelectableAspect.selected,)!
|
||||
return InheritedModel.inheritFrom<EquipmentProfiles>(
|
||||
context,
|
||||
aspect: SelectableAspect.selected,
|
||||
)!
|
||||
.selected;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -90,7 +90,7 @@ class _EquipmentProfilesScreenState extends State<EquipmentProfilesScreen> {
|
|||
}
|
||||
|
||||
void _updateProfileAt(EquipmentProfile data) {
|
||||
EquipmentProfileProvider.of(context).updateProdile(data);
|
||||
EquipmentProfileProvider.of(context).updateProfile(data);
|
||||
}
|
||||
|
||||
void _removeProfileAt(EquipmentProfile data) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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));
|
||||
},
|
Loading…
Reference in a new issue