m3_lightmeter/lib/environment.dart

34 lines
1 KiB
Dart
Raw Normal View History

class Environment {
final String sourceCodeUrl;
final String issuesReportUrl;
final String contactEmail;
2023-01-29 10:48:55 +00:00
final bool hasLightSensor;
const Environment({
required this.sourceCodeUrl,
required this.issuesReportUrl,
required this.contactEmail,
2023-01-29 10:48:55 +00:00
this.hasLightSensor = false,
});
const Environment.dev()
: sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter',
issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues',
2023-01-29 10:48:55 +00:00
contactEmail = 'contact.vodemn@gmail.com',
hasLightSensor = false;
const Environment.prod()
: sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter',
issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues',
2023-01-29 10:48:55 +00:00
contactEmail = 'contact.vodemn@gmail.com',
hasLightSensor = false;
Environment copyWith({bool? hasLightSensor}) => Environment(
sourceCodeUrl: sourceCodeUrl,
issuesReportUrl: issuesReportUrl,
contactEmail: contactEmail,
hasLightSensor: hasLightSensor ?? this.hasLightSensor,
);
}