final beta Version

This commit is contained in:
2025-08-24 19:54:36 +02:00
parent fec555991d
commit c183d84a86
16 changed files with 923 additions and 209 deletions

View File

@@ -24,7 +24,7 @@ class TankController extends GetxController {
final Rx<Position?> currentPosition = Rx<Position?>(null);
final Rx<bool> isLoading = false.obs;
final Rx<String?> errorMessage = Rx<String?>(null);
final rxOrtString = '?'.obs;
//final rxOrtString = '?'.obs;
final rxSessionIdString = '?'.obs;
final rxSummePreisString = '0.00'.obs;
// TextEditingController für die Formulareingaben
@@ -70,10 +70,10 @@ class TankController extends GetxController {
// Hier kannst du die Logik hinzufügen, um den Standort zu verwenden, z.B.
// den Standort in der UI anzuzeigen oder an einen Server zu senden.
var map = {'lat': latitude, 'lng': longitude};
rxOrtString.value = await _locationRepository.getNearbyLocation(map);
ortController.text = rxOrtString.value;
var loc = await _locationRepository.getNearbyLocation(map);
ortController.text = loc;
// Print Standortinformationen in der Konsole
print('Nearby Location: ${rxOrtString.value}');
print('Nearby Location: $loc');
print('Current Position: Latitude: $latitude, Longitude: $longitude');
} catch (e) {
// Hier fängst du die Fehler aus dem Repository auf

View File

@@ -52,117 +52,112 @@ class TankPage extends GetView<TankController> {
),
),
Obx(
() => SingleChildScrollView(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + kToolbarHeight + 20,
left: 20,
right: 20,
bottom: 20,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircleAvatar(
backgroundColor: Colors.blue,
radius: 40,
child: Text(
controller.circleAvatarUserChar.value,
style: const TextStyle(
color: Colors.black,
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 5),
Text(
controller.userNameToDisplay.value,
style: const TextStyle(
fontSize: 20,
backgroundColor: Colors.black87,
color: Colors.white,
fontWeight: FontWeight.bold,
letterSpacing: 3,
),
),
controller.isLoading.value
? Text('Location is loading...')
: Text(
controller.rxOrtString.value,
style: const TextStyle(
fontSize: 15,
backgroundColor: Colors.black87,
color: Colors.blue,
),
),
const SizedBox(height: 20),
inputFields(),
const SizedBox(height: 20),
Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.black.withValues(alpha: 0.9),
),
child: Text.rich(
TextSpan(
text: 'Summe: ',
style: TextStyle(
fontSize: 18,
color: Colors.grey.shade300,
),
children: <TextSpan>[
TextSpan(
// Hier kommt der Wert als separater TextSpan
text: controller.rxSummePreisString.value,
// Doppelt so groß wie der Standardtext',
style: TextStyle(
fontSize: 30, // Doppelt so groß wie 18
color: Colors.blue, // Blaue Farbe
fontWeight: FontWeight
.bold, // Optional: Fetter Text, um ihn hervorzuheben
),
),
],
),
),
),
const SizedBox(height: 20),
SizedBox(
width: 350,
height: 50,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue.withValues(
alpha: 0.9,
), // Button-Farbe
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10,
), // Abgerundete Ecken
),
),
onPressed: () {
controller.saveTankstopp();
},
() => PopScope(
canPop: false,
child: SingleChildScrollView(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top +
kToolbarHeight +
20,
left: 20,
right: 20,
bottom: 20,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircleAvatar(
backgroundColor: Colors.blue,
radius: 40,
child: Text(
'Tankstop erfassen',
style: TextStyle(color: Colors.white, fontSize: 20),
controller.circleAvatarUserChar.value,
style: const TextStyle(
color: Colors.black,
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
),
Container(
margin: EdgeInsets.only(top: 20, bottom: 50),
child: Text(
'Hinweis: Alle Felder sind Pflichtfelder.',
style: TextStyle(
fontSize: 16,
color: Colors.red.shade300,
const SizedBox(height: 5),
Text(
controller.userNameToDisplay.value,
style: const TextStyle(
fontSize: 20,
backgroundColor: Colors.black87,
color: Colors.white,
fontWeight: FontWeight.bold,
letterSpacing: 3,
),
),
),
],
const SizedBox(height: 20),
inputFields(),
const SizedBox(height: 20),
Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.black.withValues(alpha: 0.9),
),
child: Text.rich(
TextSpan(
text: 'Summe: ',
style: TextStyle(
fontSize: 18,
color: Colors.grey.shade300,
),
children: <TextSpan>[
TextSpan(
// Hier kommt der Wert als separater TextSpan
text: controller.rxSummePreisString.value,
// Doppelt so groß wie der Standardtext',
style: TextStyle(
fontSize: 30, // Doppelt so groß wie 18
color: Colors.blue, // Blaue Farbe
fontWeight: FontWeight
.bold, // Optional: Fetter Text, um ihn hervorzuheben
),
),
],
),
),
),
const SizedBox(height: 20),
SizedBox(
width: 350,
height: 50,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue.withValues(
alpha: 0.9,
), // Button-Farbe
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
10,
), // Abgerundete Ecken
),
),
onPressed: () {
controller.saveTankstopp();
},
child: Text(
'Tankstop erfassen',
style: TextStyle(color: Colors.white, fontSize: 20),
),
),
),
Container(
margin: EdgeInsets.only(top: 20, bottom: 50),
child: Text(
'Hinweis: Alle Felder sind Pflichtfelder.',
style: TextStyle(
fontSize: 16,
color: Colors.red.shade300,
),
),
),
],
),
),
),
),