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,
value: 'Baden-Württemberg', child: TextField(
child: Text('Baden-Württemberg'), controller: bLandC,
),
), ),
DropdownMenuItem( Expanded(
value: 'Bayern', flex: 1,
child: Text('Bayern'), child: PopupMenuButton(
), icon: const Icon(Icons.arrow_drop_down),
DropdownMenuItem( initialValue: selectedBLand,
value: 'Berlin', onSelected: (value) {
child: Text('Berlin'), setState(() {
), selectedBLand = value;
DropdownMenuItem( bLandC.text = value;
value: 'Brandenburg', });
child: Text('Brandenburg'), },
), itemBuilder: (context) => const <PopupMenuEntry>[
DropdownMenuItem( PopupMenuItem(
value: 'Bremen', value: 'Baden-Württemberg',
child: Text('Bremen'), child: Text('Baden-Württemberg'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Hamburg', value: 'Bayern',
child: Text('Hamburg'), child: Text('Bayern'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Hessen', value: 'Berlin',
child: Text('Hessen'), child: Text('Berlin'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Mecklenburg-Vorpommern', value: 'Brandenburg',
child: Text('Mecklenburg-Vorpommern'), child: Text('Brandenburg'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Niedersachsen', value: 'Bremen',
child: Text('Niedersachsen'), child: Text('Bremen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Nordrhein-Westfalen', value: 'Hamburg',
child: Text('Nordrhein-Westfalen'), child: Text('Hamburg'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Rheinland-Pfalz', value: 'Hessen',
child: Text('Rheinland-Pfalz'), child: Text('Hessen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Saarland', value: 'Mecklenburg-Vorpommern',
child: Text('Saarland'), child: Text('Mecklenburg-Vorpommern'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Sachsen', value: 'Niedersachsen',
child: Text('Sachsen'), child: Text('Niedersachsen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Sachsen-Anhalt', value: 'Nordrhein-Westfalen',
child: Text('Sachsen-Anhalt'), child: Text('Nordrhein-Westfalen'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Schleswig-Holstein', value: 'Rheinland-Pfalz',
child: Text('Schleswig-Holstein'), child: Text('Rheinland-Pfalz'),
), ),
DropdownMenuItem( PopupMenuItem(
value: 'Thüringen', value: 'Saarland',
child: Text('Thüringen'), child: Text('Saarland'),
),
PopupMenuItem(
value: 'Sachsen',
child: Text('Sachsen'),
),
PopupMenuItem(
value: 'Sachsen-Anhalt',
child: Text('Sachsen-Anhalt'),
),
PopupMenuItem(
value: 'Schleswig-Holstein',
child: Text('Schleswig-Holstein'),
),
PopupMenuItem(
value: 'Thüringen',
child: Text('Thüringen'),
),
],
),
), ),
], ],
onChanged: (value) {
setState(() {
bLandC.text = value!;
});
},
),
TextField(
controller: bLandC,
), ),
const SizedBox( const SizedBox(
height: 15, height: 15,
@@ -154,30 +166,34 @@ 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,
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
icon: const Icon(Icons.arrow_drop_down), icon: const Icon(Icons.arrow_drop_down),
initialValue: selectedApiAddress, initialValue: selectedApiAddress,
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",
PopupMenuItem( child:
value: "https://data.dbb-wolf.de/app24.php", Text(AppLocalizations.of(context)!.test)),
child: Text( AppLocalizations.of(context)!.notest)) PopupMenuItem(
], value: "https://data.dbb-wolf.de/app24.php",
)) child: Text(
AppLocalizations.of(context)!.notest))
],
))
], ],
) )
], ],