added intro screen api address selection. also added apk

This commit is contained in:
nico
2024-05-15 20:23:07 +02:00
parent 1656ffb00c
commit fd42d3fd02
4 changed files with 49 additions and 5 deletions

Binary file not shown.

View File

@@ -98,5 +98,7 @@
"sendagain": "Nochmal senden",
"successful": "Erfolgreich",
"back": "Zurück",
"loading": "Lädt"
"loading": "Lädt",
"test": "Test",
"notest": "Kein Test"
}

View File

@@ -477,6 +477,16 @@
"loading": "Loading",
"@loading": {
"description": "just Loading"
},
"test": "Test",
"@test": {
"description": "test"
},
"notest": "No Test",
"@notest": {
"description": "no test"
}
}

View File

@@ -1,7 +1,10 @@
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});
@@ -14,6 +17,8 @@ class _IntroScreenState extends State<IntroScreen> {
TextEditingController bLandC = TextEditingController();
TextEditingController apiAddress = TextEditingController();
String selectedApiAddress = "Test";
Future<void> _saveData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('addresse1', addresse1C.text);
@@ -143,10 +148,37 @@ class _IntroScreenState extends State<IntroScreen> {
const SizedBox(
height: 15,
),
TextField(
Row(
children: [
Expanded(
flex: 4,
child: TextField(
decoration: InputDecoration(
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))
],
))
],
)
],
),