let AI comment everything because well... yeah...

This commit is contained in:
Nico
2025-06-06 21:00:32 +02:00
parent 9c84d0c375
commit cc110ac104
44 changed files with 1230 additions and 646 deletions

View File

@@ -1,8 +1,18 @@
// * Widget for managing camera trap control/check dates
// * Features:
// * - Date picker for selecting control dates
// * - Date display in localized format
// * - Callback support for date changes
import 'package:flutter/material.dart';
import 'package:fforte/l10n/app_localizations.dart';
/// Widget for selecting and displaying camera trap control dates
/// Used to schedule when the camera trap should be checked
class KontDat extends StatefulWidget {
/// Initial control date, if any
final DateTime? initKontDat;
/// Callback function when date is changed
final Function(DateTime) onDateChanged;
const KontDat(
@@ -12,7 +22,9 @@ class KontDat extends StatefulWidget {
State<KontDat> createState() => _KontDatState();
}
/// State class for the control date widget
class _KontDatState extends State<KontDat> {
/// Currently selected control date
DateTime? kontDat;
@override
@@ -26,6 +38,7 @@ class _KontDatState extends State<KontDat> {
return Row(
children: [
Row(children: [
// Date picker button
SizedBox(
width: 140,
child: ElevatedButton(
@@ -39,9 +52,8 @@ class _KontDatState extends State<KontDat> {
},
child: Text(AppLocalizations.of(context)!.pickkontdat)),
),
const SizedBox(
width: 10,
),
const SizedBox(width: 10),
// Display selected date in DD.MM.YYYY format
Text(
'${kontDat?.day}. ${kontDat?.month}. ${kontDat?.year}',
),
@@ -50,6 +62,8 @@ class _KontDatState extends State<KontDat> {
);
}
/// Show date picker dialog and return selected date
/// @return Future<DateTime?> Selected date or null if cancelled
Future<DateTime?> pickDate() async {
final date = await showDatePicker(
context: context,