updated project linter-rules and enforced them
This commit is contained in:
@ -3,7 +3,7 @@ import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:marianum_mobile/extensions/dateTime.dart';
|
||||
import '../../../extensions/dateTime.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:rrule_generator/rrule_generator.dart';
|
||||
import 'package:time_range_picker/time_range_picker.dart';
|
||||
@ -32,7 +32,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
late TimeOfDay _endTime = widget.existingEvent?.endDate.toTimeOfDay() ?? const TimeOfDay(hour: 09, minute: 30);
|
||||
late final TextEditingController _eventName = TextEditingController(text: widget.existingEvent?.title);
|
||||
late final TextEditingController _eventDescription = TextEditingController(text: widget.existingEvent?.description);
|
||||
late String _recurringRule = widget.existingEvent?.rrule ?? "";
|
||||
late String _recurringRule = widget.existingEvent?.rrule ?? '';
|
||||
late CustomTimetableColors _customTimetableColor = CustomTimetableColors.values.firstWhere(
|
||||
(element) => element.name == widget.existingEvent?.color,
|
||||
orElse: () => TimetableColors.defaultColor
|
||||
@ -64,7 +64,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
controller: _eventName,
|
||||
autofocus: true,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Terminname",
|
||||
labelText: 'Terminname',
|
||||
border: OutlineInputBorder()
|
||||
),
|
||||
),
|
||||
@ -75,7 +75,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
maxLines: 2,
|
||||
minLines: 2,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Beschreibung",
|
||||
labelText: 'Beschreibung',
|
||||
border: OutlineInputBorder()
|
||||
),
|
||||
),
|
||||
@ -84,7 +84,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
ListTile(
|
||||
leading: const Icon(Icons.date_range_outlined),
|
||||
title: Text(Jiffy.parseFromDateTime(_date).yMMMd),
|
||||
subtitle: const Text("Datum"),
|
||||
subtitle: const Text('Datum'),
|
||||
onTap: () async {
|
||||
final DateTime? pickedDate = await showDatePicker(
|
||||
context: context,
|
||||
@ -101,8 +101,8 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.access_time_outlined),
|
||||
title: Text("${_startTime.format(context).toString()} - ${_endTime.format(context).toString()}"),
|
||||
subtitle: const Text("Zeitraum"),
|
||||
title: Text('${_startTime.format(context).toString()} - ${_endTime.format(context).toString()}'),
|
||||
subtitle: const Text('Zeitraum'),
|
||||
onTap: () async {
|
||||
TimeRange timeRange = await showTimeRangePicker(
|
||||
context: context,
|
||||
@ -112,8 +112,8 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
disabledColor: Colors.grey,
|
||||
paintingStyle: PaintingStyle.fill,
|
||||
interval: const Duration(minutes: 5),
|
||||
fromText: "Beginnend",
|
||||
toText: "Endend",
|
||||
fromText: 'Beginnend',
|
||||
toText: 'Endend',
|
||||
strokeColor: Theme.of(context).colorScheme.secondary,
|
||||
minDuration: const Duration(minutes: 15),
|
||||
selectedColor: Theme.of(context).primaryColor,
|
||||
@ -129,7 +129,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
const Divider(),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.color_lens_outlined),
|
||||
title: const Text("Farbgebung"),
|
||||
title: const Text('Farbgebung'),
|
||||
trailing: DropdownButton<CustomTimetableColors>(
|
||||
value: _customTimetableColor,
|
||||
icon: const Icon(Icons.arrow_drop_down),
|
||||
@ -162,7 +162,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
initialRRule: _recurringRule,
|
||||
textDelegate: const GermanRRuleTextDelegate(),
|
||||
onChange: (String newValue) {
|
||||
log("Rule: $newValue");
|
||||
log('Rule: $newValue');
|
||||
setState(() {
|
||||
_recurringRule = newValue;
|
||||
});
|
||||
@ -183,7 +183,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
if(!validate()) return;
|
||||
|
||||
CustomTimetableEvent editedEvent = CustomTimetableEvent(
|
||||
id: "",
|
||||
id: '',
|
||||
title: _eventName.text,
|
||||
description: _eventDescription.text,
|
||||
startDate: _date.withTime(_startTime),
|
||||
@ -210,7 +210,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
} else {
|
||||
UpdateCustomTimetableEvent(
|
||||
UpdateCustomTimetableEventParams(
|
||||
widget.existingEvent?.id ?? "",
|
||||
widget.existingEvent?.id ?? '',
|
||||
editedEvent
|
||||
)
|
||||
).run().then((value) {
|
||||
@ -224,7 +224,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
||||
|
||||
|
||||
},
|
||||
child: Text(isEditingExisting ? "Speichern" : "Erstellen"),
|
||||
child: Text(isEditingExisting ? 'Speichern' : 'Erstellen'),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
Reference in New Issue
Block a user