2024-07-23 13:31:36 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:lightmeter/generated/l10n.dart';
|
|
|
|
|
2024-07-15 20:00:52 +00:00
|
|
|
enum AppFeature {
|
2024-07-23 13:31:36 +00:00
|
|
|
reflectedLightMetering,
|
|
|
|
incidedntLightMetering,
|
|
|
|
isoAndNdValues,
|
|
|
|
themeEngine,
|
2024-07-15 20:00:52 +00:00
|
|
|
spotMetering,
|
|
|
|
histogram,
|
|
|
|
listOfFilms,
|
|
|
|
equipmentProfiles,
|
|
|
|
timer,
|
|
|
|
mainScreenCustomization;
|
|
|
|
|
2024-07-23 18:57:20 +00:00
|
|
|
static List<AppFeature> get androidFeatures => values;
|
|
|
|
|
|
|
|
static List<AppFeature> get iosFeatures => values.where((f) => f != AppFeature.incidedntLightMetering).toList();
|
|
|
|
|
2024-07-23 13:31:36 +00:00
|
|
|
String name(BuildContext context) {
|
|
|
|
switch (this) {
|
|
|
|
case AppFeature.reflectedLightMetering:
|
|
|
|
return S.of(context).featureReflectedLightMetering;
|
|
|
|
case AppFeature.incidedntLightMetering:
|
|
|
|
return S.of(context).featureIncidentLightMetering;
|
|
|
|
case AppFeature.isoAndNdValues:
|
|
|
|
return S.of(context).featureIsoAndNdValues;
|
|
|
|
case AppFeature.themeEngine:
|
|
|
|
return S.of(context).featureTheme;
|
|
|
|
case AppFeature.spotMetering:
|
|
|
|
return S.of(context).featureSpotMetering;
|
|
|
|
case AppFeature.histogram:
|
|
|
|
return S.of(context).featureHistogram;
|
|
|
|
case AppFeature.listOfFilms:
|
|
|
|
return S.of(context).featureListOfFilms;
|
|
|
|
case AppFeature.equipmentProfiles:
|
|
|
|
return S.of(context).featureEquipmentProfiles;
|
|
|
|
case AppFeature.timer:
|
|
|
|
return S.of(context).featureTimer;
|
|
|
|
case AppFeature.mainScreenCustomization:
|
|
|
|
return S.of(context).featureMeteringScreenLayout;
|
|
|
|
}
|
2024-07-15 20:00:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool get isFree {
|
|
|
|
switch (this) {
|
2024-07-23 13:31:36 +00:00
|
|
|
case AppFeature.reflectedLightMetering:
|
|
|
|
case AppFeature.incidedntLightMetering:
|
|
|
|
case AppFeature.isoAndNdValues:
|
|
|
|
case AppFeature.themeEngine:
|
2024-07-15 20:00:52 +00:00
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|