m3_lightmeter/lib/environment.dart
Vadim cbee0f350a
ML-37 Fix exposure pairs list creation (#39)
* integrated EV value to measure button

* fixed
2023-02-18 20:17:39 +03:00

40 lines
1.2 KiB
Dart

enum BuildType { dev, prod }
class Environment {
final BuildType buildType;
final String sourceCodeUrl;
final String issuesReportUrl;
final String contactEmail;
final bool hasLightSensor;
const Environment({
required this.buildType,
required this.sourceCodeUrl,
required this.issuesReportUrl,
required this.contactEmail,
this.hasLightSensor = false,
});
const Environment.dev()
: buildType = BuildType.dev,
sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter',
issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues',
contactEmail = 'contact.vodemn@gmail.com',
hasLightSensor = false;
const Environment.prod()
: buildType = BuildType.prod,
sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter',
issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues',
contactEmail = 'contact.vodemn@gmail.com',
hasLightSensor = false;
Environment copyWith({bool? hasLightSensor}) => Environment(
buildType: buildType,
sourceCodeUrl: sourceCodeUrl,
issuesReportUrl: issuesReportUrl,
contactEmail: contactEmail,
hasLightSensor: hasLightSensor ?? this.hasLightSensor,
);
}