let AI comment everything because well... yeah...
This commit is contained in:
@@ -1,13 +1,31 @@
|
||||
// * Widget for recording wildlife track findings during excursions
|
||||
// * Features:
|
||||
// * - Track presence recording
|
||||
// * - Track length measurement
|
||||
// * - Animal count estimation
|
||||
// * - Confidence level indication
|
||||
// * - Separate tracking for cubs/pups
|
||||
// * - Nested visibility based on selections
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fforte/l10n/app_localizations.dart';
|
||||
|
||||
/// Widget for managing wildlife track findings and measurements
|
||||
/// Includes options for both adult and cub/pup tracks
|
||||
class SpurGefunden extends StatefulWidget {
|
||||
/// Controller for track presence status
|
||||
final TextEditingController spurFund;
|
||||
/// Controller for total track length
|
||||
final TextEditingController spurLang;
|
||||
/// Controller for estimated number of animals
|
||||
final TextEditingController spurTiere;
|
||||
/// Controller for track identification confidence
|
||||
final TextEditingController spSicher;
|
||||
/// Controller for cub/pup track length
|
||||
final TextEditingController welpenSp;
|
||||
/// Controller for estimated number of cubs/pups
|
||||
final TextEditingController welpenAnz;
|
||||
/// Controller for cub/pup track identification confidence
|
||||
final TextEditingController wpSicher;
|
||||
|
||||
const SpurGefunden({
|
||||
@@ -25,14 +43,20 @@ class SpurGefunden extends StatefulWidget {
|
||||
State<SpurGefunden> createState() => _SpurGefundenState();
|
||||
}
|
||||
|
||||
/// State class for the track findings widget
|
||||
class _SpurGefundenState extends State<SpurGefunden> {
|
||||
/// Whether any tracks were found
|
||||
late bool _spurFundChecked;
|
||||
/// Whether adult track identification is confident
|
||||
bool _spSicher = false;
|
||||
/// Whether cub/pup track identification is confident
|
||||
bool _wpSicher = false;
|
||||
/// Whether cub/pup tracks were found
|
||||
late bool _welpenSpFundChecked;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// Initialize track finding states
|
||||
if (widget.spurFund.text == "") {
|
||||
_spurFundChecked = false;
|
||||
_welpenSpFundChecked = false;
|
||||
@@ -53,6 +77,7 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
// Track presence checkbox
|
||||
Row(
|
||||
children: [
|
||||
Text(AppLocalizations.of(context)!.spurGefunden),
|
||||
@@ -65,22 +90,14 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
});
|
||||
},
|
||||
),
|
||||
// Text(AppLocalizations.of(context)!.welpenSpurGefunden),
|
||||
// Checkbox(
|
||||
// value: _welpenSpFundChecked,
|
||||
// onChanged: (val) {
|
||||
// setState(() {
|
||||
// _welpenSpFundChecked = val ?? false;
|
||||
// widget.welpenSp.text = val ?? false ? "WelpenSp" : "";
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
// Track details section (visible when tracks found)
|
||||
Visibility(
|
||||
visible: _spurFundChecked,
|
||||
child: Column(
|
||||
children: [
|
||||
// Total track length input
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -101,7 +118,7 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// Estimated animal count input
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -124,6 +141,7 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
),
|
||||
],
|
||||
),
|
||||
// Track identification confidence
|
||||
Row(
|
||||
children: [
|
||||
Text(AppLocalizations.of(context)!.sicher),
|
||||
@@ -139,7 +157,7 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// Cub/pup track presence checkbox
|
||||
Row(
|
||||
children: [
|
||||
Text(AppLocalizations.of(context)!.welpenSpurGefunden),
|
||||
@@ -153,10 +171,12 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
),
|
||||
],
|
||||
),
|
||||
// Cub/pup track details section
|
||||
Visibility(
|
||||
visible: _welpenSpFundChecked,
|
||||
child: Column(
|
||||
children: [
|
||||
// Cub/pup track length input
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -179,9 +199,7 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// const SizedBox(height: 10),
|
||||
|
||||
// Estimated cub/pup count input
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -204,6 +222,7 @@ class _SpurGefundenState extends State<SpurGefunden> {
|
||||
),
|
||||
],
|
||||
),
|
||||
// Cub/pup track identification confidence
|
||||
Row(
|
||||
children: [
|
||||
Text(AppLocalizations.of(context)!.sicher),
|
||||
|
||||
Reference in New Issue
Block a user