updated project linter-rules and enforced them
This commit is contained in:
@ -42,23 +42,23 @@ class _HolidaysState extends State<Holidays> {
|
||||
}
|
||||
|
||||
String parseString(String enDate) {
|
||||
return Jiffy.parse(enDate).format(pattern: "dd.MM.yyyy");
|
||||
return Jiffy.parse(enDate).format(pattern: 'dd.MM.yyyy');
|
||||
}
|
||||
|
||||
void showDisclaimer() {
|
||||
showDialog(context: context, builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text("Richtigkeit und Bereitstellung der Daten"),
|
||||
title: const Text('Richtigkeit und Bereitstellung der Daten'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text(""
|
||||
"Sämtliche Datumsangaben sind ohne Gewähr.\n"
|
||||
"Ich übernehme weder Verantwortung für die Richtigkeit der Daten noch hafte ich für wirtschaftliche Schäden die aus der Verwendung dieser Daten entstehen können.\n\n"
|
||||
"Die Daten stammen von https://ferien-api.de/"),
|
||||
const Text(''
|
||||
'Sämtliche Datumsangaben sind ohne Gewähr.\n'
|
||||
'Ich übernehme weder Verantwortung für die Richtigkeit der Daten noch hafte ich für wirtschaftliche Schäden die aus der Verwendung dieser Daten entstehen können.\n\n'
|
||||
'Die Daten stammen von https://ferien-api.de/'),
|
||||
const SizedBox(height: 30),
|
||||
ListTile(
|
||||
title: const Text("Diese Meldung nicht mehr anzeigen"),
|
||||
title: const Text('Diese Meldung nicht mehr anzeigen'),
|
||||
trailing: Checkbox(
|
||||
value: settings.val().holidaysSettings.dismissedDisclaimer,
|
||||
onChanged: (value) => settings.val(write: true).holidaysSettings.dismissedDisclaimer = value!,
|
||||
@ -67,8 +67,8 @@ class _HolidaysState extends State<Holidays> {
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(child: const Text("ferien-api.de besuchen"), onPressed: () => ConfirmDialog.openBrowser(context, "https://ferien-api.de/")),
|
||||
TextButton(child: const Text("Okay"), onPressed: () => Navigator.of(context).pop()),
|
||||
TextButton(child: const Text('ferien-api.de besuchen'), onPressed: () => ConfirmDialog.openBrowser(context, 'https://ferien-api.de/')),
|
||||
TextButton(child: const Text('Okay'), onPressed: () => Navigator.of(context).pop()),
|
||||
],
|
||||
);
|
||||
});
|
||||
@ -78,11 +78,11 @@ class _HolidaysState extends State<Holidays> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Schulferien in Hessen"),
|
||||
title: const Text('Schulferien in Hessen'),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.warning_amber_outlined),
|
||||
onPressed: () => showDisclaimer(),
|
||||
onPressed: showDisclaimer,
|
||||
),
|
||||
PopupMenuButton<bool>(
|
||||
initialValue: settings.val().holidaysSettings.showPastEvents,
|
||||
@ -95,7 +95,7 @@ class _HolidaysState extends State<Holidays> {
|
||||
children: [
|
||||
Icon(e ? Icons.history_outlined : Icons.history_toggle_off_outlined, color: Theme.of(context).colorScheme.onSurface),
|
||||
const SizedBox(width: 15),
|
||||
Text(e ? "Alle anzeigen" : "Nur zukünftige anzeigen")
|
||||
Text(e ? 'Alle anzeigen' : 'Nur zukünftige anzeigen')
|
||||
],
|
||||
)
|
||||
)).toList();
|
||||
@ -115,19 +115,19 @@ class _HolidaysState extends State<Holidays> {
|
||||
List<GetHolidaysResponseObject> holidays = value.getHolidaysResponse.data;
|
||||
if(!showPastEvents) holidays = holidays.where((element) => DateTime.parse(element.end).isAfter(DateTime.now())).toList();
|
||||
|
||||
if(holidays.isEmpty) return const PlaceholderView(icon: Icons.search_off, text: "Es wurden keine Ferieneinträge gefunden!");
|
||||
if(holidays.isEmpty) return const PlaceholderView(icon: Icons.search_off, text: 'Es wurden keine Ferieneinträge gefunden!');
|
||||
|
||||
return ListView.builder(
|
||||
itemCount: holidays.length,
|
||||
itemBuilder: (context, index) {
|
||||
GetHolidaysResponseObject holiday = holidays[index];
|
||||
String holidayType = holiday.name.split(" ").first.capitalize();
|
||||
String holidayType = holiday.name.split(' ').first.capitalize();
|
||||
return ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.calendar_month)),
|
||||
title: Text("$holidayType ab ${parseString(holiday.start)}"),
|
||||
subtitle: Text("bis ${parseString(holiday.end)}"),
|
||||
title: Text('$holidayType ab ${parseString(holiday.start)}'),
|
||||
subtitle: Text('bis ${parseString(holiday.end)}'),
|
||||
onTap: () => showDialog(context: context, builder: (context) => SimpleDialog(
|
||||
title: Text("$holidayType ${holiday.year} in Hessen"),
|
||||
title: Text('$holidayType ${holiday.year} in Hessen'),
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.signpost_outlined)),
|
||||
@ -136,11 +136,11 @@ class _HolidaysState extends State<Holidays> {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.arrow_forward),
|
||||
title: Text("vom ${parseString(holiday.start)}"),
|
||||
title: Text('vom ${parseString(holiday.start)}'),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.arrow_back),
|
||||
title: Text("bis zum ${parseString(holiday.end)}"),
|
||||
title: Text('bis zum ${parseString(holiday.end)}'),
|
||||
),
|
||||
Visibility(
|
||||
visible: !DateTime.parse(holiday.start).difference(DateTime.now()).isNegative,
|
||||
|
Reference in New Issue
Block a user