mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10:40 +00:00
removed equipment section
This commit is contained in:
parent
bac2fe9135
commit
c2a9730012
10 changed files with 51 additions and 161 deletions
|
@ -8,6 +8,7 @@ import 'package:lightmeter/data/caffeine_service.dart';
|
|||
import 'package:lightmeter/data/haptics_service.dart';
|
||||
import 'package:lightmeter/data/models/supported_locale.dart';
|
||||
import 'package:lightmeter/providers/supported_locale_provider.dart';
|
||||
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
|
@ -16,7 +17,6 @@ import 'data/permissions_service.dart';
|
|||
import 'data/shared_prefs_service.dart';
|
||||
import 'environment.dart';
|
||||
import 'generated/l10n.dart';
|
||||
import 'providers/equipment_profile_provider.dart';
|
||||
import 'providers/ev_source_type_provider.dart';
|
||||
import 'providers/theme_provider.dart';
|
||||
import 'screens/metering/flow_metering.dart';
|
||||
|
|
|
@ -35,8 +35,14 @@
|
|||
"camera": "Camera",
|
||||
"lightSensor": "Light sensor",
|
||||
"equipment": "Equipment",
|
||||
"isoValues": "ISO values",
|
||||
"apertureValues": "Aperture values",
|
||||
"apertureValuesFilterDescription": "Select the range of aperture values to display. This is usually determined by the lens you are using.",
|
||||
"ndFilters": "ND filters",
|
||||
"ndFiltersFilterDescription": "Select the ND filters to display. These may be your most commonly used ND filters or the ones that fit your lens.",
|
||||
"shutterSpeedValues": "Shutter speed values",
|
||||
"shutterSpeedValuesFilterDescription": "Select the range of shutter speed values to display. This is usually determined by the camera body you are using.",
|
||||
"isoValues": "ISO values",
|
||||
"isoValuesFilterDescription": "Select the ISO values to display. These may be your most commonly used values or those supported by your camera.",
|
||||
"equipmentProfiles": "Equipment profiles",
|
||||
"general": "General",
|
||||
"keepScreenOn": "Keep screen on",
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/data/models/equipment_profile_data.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/nd_value.dart';
|
||||
import 'package:lightmeter/data/models/photography_values/shutter_speed_value.dart';
|
||||
|
||||
class EquipmentProfileProvider extends StatefulWidget {
|
||||
final Widget child;
|
||||
|
||||
const EquipmentProfileProvider({required this.child, super.key});
|
||||
|
||||
static EquipmentProfileProviderState of(BuildContext context) {
|
||||
return context.findAncestorStateOfType<EquipmentProfileProviderState>()!;
|
||||
}
|
||||
|
||||
@override
|
||||
State<EquipmentProfileProvider> createState() => EquipmentProfileProviderState();
|
||||
}
|
||||
|
||||
class EquipmentProfileProviderState extends State<EquipmentProfileProvider> {
|
||||
final List<EquipmentProfileData> _profiles = [
|
||||
const EquipmentProfileData(
|
||||
id: '0',
|
||||
name: 'Default',
|
||||
apertureValues: apertureValues,
|
||||
ndValues: ndValues,
|
||||
shutterSpeedValues: shutterSpeedValues,
|
||||
isoValues: isoValues,
|
||||
),
|
||||
];
|
||||
late EquipmentProfileData? _selectedProfile = _profiles.isNotEmpty ? _profiles.first : null;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return EquipmentProfiles(
|
||||
profiles: _profiles,
|
||||
child: EquipmentProfile(
|
||||
data: _selectedProfile,
|
||||
child: widget.child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void setProfile(EquipmentProfileData data) {
|
||||
setState(() {
|
||||
_selectedProfile = data;
|
||||
});
|
||||
}
|
||||
|
||||
void addProfile(EquipmentProfileData data) {}
|
||||
|
||||
void updateProdile(EquipmentProfileData data) {}
|
||||
|
||||
void deleteProfile(EquipmentProfileData data) {}
|
||||
}
|
||||
|
||||
class EquipmentProfiles extends InheritedWidget {
|
||||
final List<EquipmentProfileData> profiles;
|
||||
|
||||
const EquipmentProfiles({
|
||||
required this.profiles,
|
||||
required super.child,
|
||||
super.key,
|
||||
});
|
||||
|
||||
static List<EquipmentProfileData>? of(BuildContext context) {
|
||||
return context.dependOnInheritedWidgetOfExactType<EquipmentProfiles>()?.profiles;
|
||||
}
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(EquipmentProfiles oldWidget) => true;
|
||||
}
|
||||
|
||||
class EquipmentProfile extends InheritedWidget {
|
||||
final EquipmentProfileData? data;
|
||||
|
||||
const EquipmentProfile({
|
||||
required this.data,
|
||||
required super.child,
|
||||
super.key,
|
||||
});
|
||||
|
||||
static EquipmentProfileData? of(BuildContext context) {
|
||||
return context.dependOnInheritedWidgetOfExactType<EquipmentProfile>()?.data;
|
||||
}
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(EquipmentProfile oldWidget) => true;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
|
||||
class EquipmentProfilesListTile extends StatelessWidget {
|
||||
const EquipmentProfilesListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.camera),
|
||||
title: Text(S.of(context).equipmentProfiles),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
|
||||
class IsoValuesListTile extends StatelessWidget {
|
||||
const IsoValuesListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.iso),
|
||||
title: Text(S.of(context).isoValues),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
|
||||
class NdFiltersListTile extends StatelessWidget {
|
||||
const NdFiltersListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.filter_b_and_w),
|
||||
title: Text(S.of(context).ndFilters),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
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/equipment_profiles/widget_list_tile_equipment_profiles.dart';
|
||||
import 'components/iso_values/widget_list_tile_iso_values.dart';
|
||||
import 'components/nd_filters/widget_list_tile_nd_filters.dart';
|
||||
|
||||
|
||||
class EquipmentSettingsSection extends StatelessWidget {
|
||||
const EquipmentSettingsSection({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SettingsSection(
|
||||
enabled: false,
|
||||
title: S.of(context).equipment,
|
||||
children: const [
|
||||
IsoValuesListTile(),
|
||||
NdFiltersListTile(),
|
||||
EquipmentProfilesListTile(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||
|
||||
class EquipmentProfilesListTile extends StatelessWidget {
|
||||
const EquipmentProfilesListTile({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.camera),
|
||||
title: Text(S.of(context).equipmentProfiles),
|
||||
onTap: () {
|
||||
showEquipmentProfilesDialog(
|
||||
context,
|
||||
EquipmentProfilesDialogLocalizationData(
|
||||
title: S.of(context).equipmentProfiles,
|
||||
addProfile: '',
|
||||
equipmentProfileScreenLocalizationData: EquipmentProfileScreenLocalizationData(
|
||||
isoValues: S.of(context).isoValues,
|
||||
isoValuesFilterDescription: S.of(context).isoValuesFilterDescription,
|
||||
ndValues: S.of(context).ndFilters,
|
||||
ndValuesFilterDescription: S.of(context).ndFiltersFilterDescription,
|
||||
apertureValues: S.of(context).apertureValues,
|
||||
apertureValuesFilterDescription: S.of(context).apertureValuesFilterDescription,
|
||||
shutterSpeedValues: S.of(context).shutterSpeedValues,
|
||||
shutterSpeedValuesFilterDescription:
|
||||
S.of(context).shutterSpeedValuesFilterDescription,
|
||||
dialogFilterLocalizationData: DialogFilterLocalizationData(
|
||||
cancel: S.of(context).cancel,
|
||||
save: S.of(context).save,
|
||||
),
|
||||
),
|
||||
cancel: S.of(context).cancel,
|
||||
select: S.of(context).select,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ 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/equipment_profiles/widget_list_tile_equipment_profiles.dart';
|
||||
import 'components/fractional_stops/widget_list_tile_fractional_stops.dart';
|
||||
|
||||
class MeteringSettingsSection extends StatelessWidget {
|
||||
|
@ -15,6 +16,7 @@ class MeteringSettingsSection extends StatelessWidget {
|
|||
children: const [
|
||||
StopTypeListTile(),
|
||||
CalibrationListTile(),
|
||||
EquipmentProfilesListTile(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:lightmeter/generated/l10n.dart';
|
|||
import 'package:lightmeter/res/dimens.dart';
|
||||
|
||||
import 'components/about/widget_settings_section_about.dart';
|
||||
import 'components/equipment/widget_settings_section_equipment.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';
|
||||
|
@ -45,7 +44,6 @@ class SettingsScreen extends StatelessWidget {
|
|||
delegate: SliverChildListDelegate(
|
||||
<Widget>[
|
||||
const MeteringSettingsSection(),
|
||||
const EquipmentSettingsSection(),
|
||||
const GeneralSettingsSection(),
|
||||
const ThemeSettingsSection(),
|
||||
const AboutSettingsSection(),
|
||||
|
|
Loading…
Reference in a new issue