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