2023-02-18 17:17:39 +00:00
|
|
|
enum BuildType { dev, prod }
|
|
|
|
|
2023-01-25 10:08:11 +00:00
|
|
|
class Environment {
|
2023-02-18 17:17:39 +00:00
|
|
|
final BuildType buildType;
|
2023-01-25 10:08:11 +00:00
|
|
|
final String sourceCodeUrl;
|
|
|
|
final String issuesReportUrl;
|
|
|
|
final String contactEmail;
|
|
|
|
|
2023-01-29 16:57:47 +00:00
|
|
|
final bool hasLightSensor;
|
|
|
|
|
2023-01-25 10:08:11 +00:00
|
|
|
const Environment({
|
2023-02-18 17:17:39 +00:00
|
|
|
required this.buildType,
|
2023-01-25 10:08:11 +00:00
|
|
|
required this.sourceCodeUrl,
|
|
|
|
required this.issuesReportUrl,
|
|
|
|
required this.contactEmail,
|
2023-01-29 16:57:47 +00:00
|
|
|
this.hasLightSensor = false,
|
2023-01-25 10:08:11 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const Environment.dev()
|
2023-02-18 17:17:39 +00:00
|
|
|
: buildType = BuildType.dev,
|
|
|
|
sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter',
|
2023-01-25 10:08:11 +00:00
|
|
|
issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues',
|
2023-01-29 16:57:47 +00:00
|
|
|
contactEmail = 'contact.vodemn@gmail.com',
|
|
|
|
hasLightSensor = false;
|
2023-01-25 10:08:11 +00:00
|
|
|
|
|
|
|
const Environment.prod()
|
2023-02-18 17:17:39 +00:00
|
|
|
: buildType = BuildType.prod,
|
|
|
|
sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter',
|
2023-01-25 10:08:11 +00:00
|
|
|
issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues',
|
2023-01-29 16:57:47 +00:00
|
|
|
contactEmail = 'contact.vodemn@gmail.com',
|
|
|
|
hasLightSensor = false;
|
|
|
|
|
|
|
|
Environment copyWith({bool? hasLightSensor}) => Environment(
|
2023-02-18 17:17:39 +00:00
|
|
|
buildType: buildType,
|
2023-01-29 16:57:47 +00:00
|
|
|
sourceCodeUrl: sourceCodeUrl,
|
|
|
|
issuesReportUrl: issuesReportUrl,
|
|
|
|
contactEmail: contactEmail,
|
|
|
|
hasLightSensor: hasLightSensor ?? this.hasLightSensor,
|
|
|
|
);
|
2023-01-25 10:08:11 +00:00
|
|
|
}
|