redesigned login screen and apk

This commit is contained in:
nico
2024-05-15 20:36:53 +02:00
parent fd42d3fd02
commit 89bf62bdb4
2 changed files with 111 additions and 95 deletions

Binary file not shown.

View File

@@ -1,10 +1,9 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class IntroScreen extends StatefulWidget { class IntroScreen extends StatefulWidget {
const IntroScreen({super.key}); const IntroScreen({super.key});
@@ -18,6 +17,7 @@ class _IntroScreenState extends State<IntroScreen> {
TextEditingController apiAddress = TextEditingController(); TextEditingController apiAddress = TextEditingController();
String selectedApiAddress = "Test"; String selectedApiAddress = "Test";
String? selectedBLand;
Future<void> _saveData() async { Future<void> _saveData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
@@ -68,82 +68,94 @@ class _IntroScreenState extends State<IntroScreen> {
), ),
Column( Column(
children: [ children: [
DropdownButton( Row(
hint: Text(bLandC.text), children: [
items: const [ Expanded(
DropdownMenuItem( flex: 4,
child: TextField(
controller: bLandC,
),
),
Expanded(
flex: 1,
child: PopupMenuButton(
icon: const Icon(Icons.arrow_drop_down),
initialValue: selectedBLand,
onSelected: (value) {
setState(() {
selectedBLand = value;
bLandC.text = value;
});
},
itemBuilder: (context) => const <PopupMenuEntry>[
PopupMenuItem(
value: 'Baden-Württemberg', value: 'Baden-Württemberg',
child: Text('Baden-Württemberg'), child: Text('Baden-Württemberg'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Bayern', value: 'Bayern',
child: Text('Bayern'), child: Text('Bayern'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Berlin', value: 'Berlin',
child: Text('Berlin'), child: Text('Berlin'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Brandenburg', value: 'Brandenburg',
child: Text('Brandenburg'), child: Text('Brandenburg'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Bremen', value: 'Bremen',
child: Text('Bremen'), child: Text('Bremen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Hamburg', value: 'Hamburg',
child: Text('Hamburg'), child: Text('Hamburg'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Hessen', value: 'Hessen',
child: Text('Hessen'), child: Text('Hessen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Mecklenburg-Vorpommern', value: 'Mecklenburg-Vorpommern',
child: Text('Mecklenburg-Vorpommern'), child: Text('Mecklenburg-Vorpommern'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Niedersachsen', value: 'Niedersachsen',
child: Text('Niedersachsen'), child: Text('Niedersachsen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Nordrhein-Westfalen', value: 'Nordrhein-Westfalen',
child: Text('Nordrhein-Westfalen'), child: Text('Nordrhein-Westfalen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Rheinland-Pfalz', value: 'Rheinland-Pfalz',
child: Text('Rheinland-Pfalz'), child: Text('Rheinland-Pfalz'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Saarland', value: 'Saarland',
child: Text('Saarland'), child: Text('Saarland'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Sachsen', value: 'Sachsen',
child: Text('Sachsen'), child: Text('Sachsen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Sachsen-Anhalt', value: 'Sachsen-Anhalt',
child: Text('Sachsen-Anhalt'), child: Text('Sachsen-Anhalt'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Schleswig-Holstein', value: 'Schleswig-Holstein',
child: Text('Schleswig-Holstein'), child: Text('Schleswig-Holstein'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Thüringen', value: 'Thüringen',
child: Text('Thüringen'), child: Text('Thüringen'),
), ),
], ],
onChanged: (value) {
setState(() {
bLandC.text = value!;
});
},
), ),
TextField( ),
controller: bLandC, ],
), ),
const SizedBox( const SizedBox(
height: 15, height: 15,
@@ -154,7 +166,8 @@ class _IntroScreenState extends State<IntroScreen> {
flex: 4, flex: 4,
child: TextField( child: TextField(
decoration: InputDecoration( decoration: InputDecoration(
hintText: AppLocalizations.of(context)!.apiaddress), hintText:
AppLocalizations.of(context)!.apiaddress),
controller: apiAddress, controller: apiAddress,
), ),
), ),
@@ -166,16 +179,19 @@ class _IntroScreenState extends State<IntroScreen> {
onSelected: (value) { onSelected: (value) {
setState(() { setState(() {
selectedApiAddress = value; selectedApiAddress = value;
apiAddress.text = selectedApiAddress; apiAddress.text = value;
}); });
}, },
itemBuilder: (context) => <PopupMenuEntry>[ itemBuilder: (context) => <PopupMenuEntry>[
PopupMenuItem( PopupMenuItem(
value: "http://192.168.1.106/www.dbb-wolf.de/data/app24.php", value:
child: Text( AppLocalizations.of(context)!.test)), "http://192.168.1.106/www.dbb-wolf.de/data/app24.php",
child:
Text(AppLocalizations.of(context)!.test)),
PopupMenuItem( PopupMenuItem(
value: "https://data.dbb-wolf.de/app24.php", value: "https://data.dbb-wolf.de/app24.php",
child: Text( AppLocalizations.of(context)!.notest)) child: Text(
AppLocalizations.of(context)!.notest))
], ],
)) ))
], ],