This repository has been archived on 2024-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
app/lib/state/legalStatusState.dart

61 lines
1.6 KiB
Dart

import 'package:app/model/legelState.dart';
import 'package:app/model/stateInfo.dart';
import 'package:flutter/material.dart';
class LegalStatusState extends ChangeNotifier {
LegalState _legalState = LegalState.unknown;
LegalState get getLegalState => _legalState;
StateInfo get info {
switch(_legalState) {
case LegalState.allowed:
return StateInfo(
icon: Icons.check,
color: Colors.lightGreen,
title: "Passt",
subtitle: "Alle kriterien erfüllt",
description: "asd"
);
case LegalState.disallowedTime:
return StateInfo(
icon: Icons.timer_outlined,
color: Colors.amber,
title: "Zu früh",
subtitle: "Bubazen ist nur zwischn 20 und 6 uhr Abends/ Nachts erlaubt!",
description: "asd"
);
case LegalState.disallowedRegion:
return StateInfo(
icon: Icons.location_off_outlined,
color: Colors.red,
title: "Zu nah an einem geschützen Gebäude",
subtitle: "asd",
description: "asd"
);
case LegalState.unknown:
default:
return StateInfo(
icon: Icons.question_mark_outlined,
color: Colors.grey,
title: "Status nicht bekannt",
subtitle: "asd",
description: "asd"
);
}
}
set setInSightOfDisallowedAreas(bool isInSight) {
_legalState = LegalState.disallowedRegion;
notifyListeners();
}
set setIsInDisallowedTimeRanges(bool isInDisallowedTime) {
_legalState = LegalState.disallowedTime;
notifyListeners();
}
}