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-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-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,
|
2023-01-29 16:57:47 +00:00
|
|
|
hasLightSensor = false;
|
2023-01-25 10:08:11 +00:00
|
|
|
|
|
|
|
const Environment.prod()
|
2023-02-18 17:17:39 +00:00
|
|
|
: buildType = BuildType.prod,
|
2023-01-29 16:57:47 +00:00
|
|
|
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
|
|
|
hasLightSensor: hasLightSensor ?? this.hasLightSensor,
|
|
|
|
);
|
2023-01-25 10:08:11 +00:00
|
|
|
}
|