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

@@ -3,25 +3,31 @@ import 'package:flutter/material.dart';
import 'l10n/app_localizations.dart';
import 'screens/addCam/add_cam_main.dart';
// * The homepage where you can choose to add something or view the database entries
// * Home screen of the LUPUS app
// * Serves as the main navigation hub with sections for:
// * - Camera trap management
// * - Excursion tracking
// * - File operations
// * - Settings access
/// Home screen widget providing access to all main app features
class HomePage extends StatelessWidget {
const HomePage({super.key});
// Commented out legacy file sending functionality
// void _sendFile() async {
// // FilePickerResult? result = await FilePicker.platform.pickFiles();
// // if (result != null) {
// // File file = File(result.files.single.path!);
// // String content = await file.readAsString();
// // HttpRequest.httpRequest(saveDataString: content);
// }
// // }
// }
@override
Widget build(BuildContext context) {
return Scaffold(
// App bar with settings menu
appBar: AppBar(
title: const Text("LUPUS"),
actions: [
@@ -29,28 +35,35 @@ class HomePage extends StatelessWidget {
onSelected: (value) {
Navigator.pushNamed(context, value.toString());
},
itemBuilder:
(context) => [
PopupMenuItem(
value: '/settings',
child: Text(AppLocalizations.of(context)!.settings),
),
PopupMenuItem(
value: '/introScreen',
child: Text(AppLocalizations.of(context)!.showloginscreen),
),
],
itemBuilder: (context) => [
// Settings menu option
PopupMenuItem(
value: '/settings',
child: Text(AppLocalizations.of(context)!.settings),
),
// Option to show intro screen
PopupMenuItem(
value: '/introScreen',
child: Text(AppLocalizations.of(context)!.showloginscreen),
),
],
),
],
),
// Main content area
body: Column(
children: [
// App logo at the top
Image.asset('assets/images/reconix_small.png'),
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 30),
// * Camera Trap Management Section
// Button to add new camera location
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40),
@@ -66,6 +79,7 @@ class HomePage extends StatelessWidget {
},
child: Text(AppLocalizations.of(context)!.addplace),
),
// Button to view camera locations
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40),
@@ -73,19 +87,23 @@ class HomePage extends StatelessWidget {
onPressed: () => Navigator.pushNamed(context, '/viewCams'),
child: Text(AppLocalizations.of(context)!.viewplaces),
),
// Visual section divider
const SizedBox(height: 20),
const Divider(),
const SizedBox(height: 20),
// * Excursion Management Section
// Button to start new excursion
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40),
),
onPressed: () => Navigator.pushNamed(context, '/excursion'),
child: Text(AppLocalizations.of(context)!.excursion),
), // Excursion
),
const SizedBox(height: 10),
// Button to view excursions
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40),
@@ -93,10 +111,14 @@ class HomePage extends StatelessWidget {
onPressed: () => Navigator.pushNamed(context, '/viewExcursionen'),
child: Text(AppLocalizations.of(context)!.viewExcursionen),
),
// Visual section divider
const SizedBox(height: 20),
const Divider(),
const SizedBox(height: 20),
// * File Operations Section
// Button to send data files
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40),