haufen ide zeugs (nich mit abgerechnet) u fix android

This commit is contained in:
Nico
2024-11-20 23:03:53 +01:00
parent c292476322
commit 2a83daab4c
111 changed files with 143 additions and 3891 deletions

View File

@@ -1,97 +0,0 @@
import 'dart:io';
import 'package:fforte/methods/http_request.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_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
class HomePage extends StatelessWidget {
const HomePage({super.key});
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(content);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.homePageTitle),
actions: [
PopupMenuButton(
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))
])
],
),
body: Column(
children: [
Image.asset('assets/images/reconix_small.png'),
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 30,),
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40),
padding: const EdgeInsets.fromLTRB(10, 5, 10, 5),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AddCamMain()));
},
child: Text(AppLocalizations.of(context)!.addplace)),
const SizedBox(height: 10,),
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40)
),
onPressed: () => Navigator.pushNamed(context, '/viewCams'),
child: Text(AppLocalizations.of(context)!.viewplaces)),
const SizedBox(height: 10,),
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40)
),
onPressed: () {
_sendFile();
},
child: Text(AppLocalizations.of(context)!.sendfile)),
const SizedBox(height: 10,),
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40)
),
onPressed: () => Navigator.pushNamed(context, '/Excursion'),
child: const Text("Excusion")),
],
)),
],
),
);
}
}

View File

@@ -64,6 +64,15 @@ class HomePage extends StatelessWidget {
builder: (context) => const AddCamMain()));
},
child: Text(AppLocalizations.of(context)!.addplace)),
const SizedBox(height: 10,),
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,),
ElevatedButton(
style: ElevatedButton.styleFrom(
@@ -71,6 +80,7 @@ class HomePage extends StatelessWidget {
),
onPressed: () => Navigator.pushNamed(context, '/viewCams'),
child: Text(AppLocalizations.of(context)!.viewplaces)),
const SizedBox(height: 10,),
ElevatedButton(
style: ElevatedButton.styleFrom(
@@ -80,14 +90,6 @@ class HomePage extends StatelessWidget {
_sendFile();
},
child: Text(AppLocalizations.of(context)!.sendfile)),
const SizedBox(height: 10,),
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(250, 40)
),
onPressed: () => Navigator.pushNamed(context, '/Excursion'),
child: const Text("Excusion")),
],
)),
],

View File

@@ -492,6 +492,12 @@
"notest": "No Test",
"@notest": {
"description": "no test"
}
},
"excursion": "Excursion",
"@excursion": {
"description": "no test"
}
}

View File

@@ -1,3 +1,4 @@
import 'package:fforte/screens/Excursion/excursion_main.dart';
import 'package:fforte/screens/addCam/add_cam_main.dart';
import 'package:fforte/screens/intro_screen.dart';
import 'package:fforte/screens/settings.dart';
@@ -15,14 +16,14 @@ import 'l10n/l10n.dart';
runApp(const MyApp());
} */
void main() async {
WidgetsFlutterBinding.ensureInitialized();
SharedPreferences prefs = await SharedPreferences.getInstance();
bool isFirstLaunch = prefs.getBool('isFirstLaunch') ?? true;
await prefs.setString('kTage1', "28");
await prefs.setString('kTage2', "48");
await prefs.setString('apiAddress', 'http://192.168.1.106/www.dbb-wolf.de/data/app24.php');
await prefs.setString(
'apiAddress', 'http://192.168.1.106/www.dbb-wolf.de/data/app24.php');
runApp(MyApp(isFirstLaunch: isFirstLaunch));
}
@@ -30,14 +31,11 @@ class MyApp extends StatelessWidget {
final bool isFirstLaunch;
const MyApp({super.key, required this.isFirstLaunch});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'FFOrte',
theme:
FlexThemeData.light(scheme: FlexScheme.gold, useMaterial3: true),
theme: FlexThemeData.light(scheme: FlexScheme.gold, useMaterial3: true),
darkTheme:
FlexThemeData.dark(scheme: FlexScheme.greenM3, useMaterial3: true),
themeMode: ThemeMode.system,
@@ -55,7 +53,7 @@ class MyApp extends StatelessWidget {
'/viewCams': (context) => const ViewCams(),
'/introScreen': (context) => const IntroScreen(),
'/settings': (context) => const Settings(),
'/excursion': (context) => const Settings(),
'/excursion': (context) => const ExcursionMain(),
},
);
}

View File

@@ -1,15 +1,73 @@
class ExcursionMain extends StatelessWidget {
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class ExcursionMain extends StatefulWidget {
const ExcursionMain({super.key});
@override
State<ExcursionMain> createState() => _ExcursionMainState();
}
class _ExcursionMainState extends State<ExcursionMain> {
@override
Widget build(BuildContext context) {
List<Step> getSteps() => [
Step(
title: const Text("step1"),
content: const Column(
children: [
Text("data"),
],
)),
const Step(title: Text("step2"), content: Text("data"))
];
int currentStep = 0;
return Scaffold(
appBar: AppBar(
title: Text("Titlebar")
),
body: Column(
children: [
]
)
);
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.excursion),
),
body: PageTransitionSwitcher(
duration: const Duration(microseconds: 800),
transitionBuilder: (Widget child, Animation<double> animation,
Animation<double> secondaryAnimation) {
return SharedAxisTransition(
animation: animation,
secondaryAnimation: secondaryAnimation,
transitionType: SharedAxisTransitionType.vertical,
child: child,
);
},
child: Stepper(
key: ValueKey(currentStep),
steps: getSteps(),
currentStep: currentStep,
onStepTapped: (value) {
setState(() {
currentStep = value;
});
},
onStepContinue: () async {
final bool isLastStep = currentStep == getSteps().length - 1;
if (!isLastStep) {
setState(() {
currentStep += 1;
});
}
},
onStepCancel: () {
if (currentStep == 0) {
Navigator.pop(context);
} else {
setState(() {
currentStep -= 1;
});
}
},
),
));
}
}

View File

@@ -1,5 +1,5 @@
import 'package:fforte/other/db_helper.dart';
import 'package:fforte/methods/db_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_map/flutter_map.dart';

View File

@@ -1,5 +1,5 @@
import 'package:fforte/addCam/add_cam_main.dart';
import 'package:fforte/other/db_helper.dart';
import 'package:fforte/screens/addCam/add_cam_main.dart';
import 'package:fforte/methods/db_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_map/flutter_map.dart';