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

@@ -6,6 +6,7 @@ import 'package:get_storage/get_storage.dart';
import '../../data/models/tank_model.dart';
import '../../data/repository/appwrite_repository.dart';
import '../../pages/tank/tank_view.dart';
import '../graph/graph_view.dart';
import '../login/login_view.dart';
class TanklistController extends GetxController {
@@ -68,7 +69,7 @@ class TanklistController extends GetxController {
message = 'Fehler beim Laden der Tankliste';
print('Error fetching tank list: $e');
} finally {
if (!isErrorByLoading){
if (!isErrorByLoading) {
isloadingList(false);
}
}
@@ -104,10 +105,6 @@ class TanklistController extends GetxController {
}
void goToChartView() {
//Get.offAndToNamed(GraphPage.namedRoute);
}
void goToTrackingPage() {
//Get.offAndToNamed(TrackingPage.namedRoute);
Get.offAndToNamed(GraphPage.namedRoute);
}
}

View File

@@ -10,94 +10,86 @@ class TanklistPage extends GetView<TanklistController> {
@override
Widget build(BuildContext context) {
var tankListCtrl = controller;
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('Tankstops'),
centerTitle: true,
//backgroundColor: Colors.grey.shade600,
actions: [
IconButton(
icon: Icon(Icons.add_chart, color: Colors.grey.shade300),
onPressed: () async {
// Handle go to Chart View
tankListCtrl.goToChartView();
},
),
IconButton(
icon: Icon(Icons.logout, color: Colors.grey.shade300),
onPressed: () async {
// Handle logout logic here
tankListCtrl.logoutSessionAndGoToLoginPage();
},
),
],
),
floatingActionButton: Column(
mainAxisAlignment:
MainAxisAlignment.end, // Positioniere die Buttons am unteren Ende
crossAxisAlignment: CrossAxisAlignment.end, // Richte sie rechts aus
mainAxisSize: MainAxisSize.min, // Nimm nur den benötigten Platz ein
children: [
FloatingActionButton(
onPressed: () => tankListCtrl.goToInputPage(),
backgroundColor: Colors.blue,
child: Icon(Icons.add),
),
const SizedBox(width: 16),
FloatingActionButton(
onPressed: () => tankListCtrl.goToTrackingPage(),
backgroundColor: Colors.green,
child: Icon(Icons.gps_fixed_rounded),
),
],
),
body: Obx(()
=> tankListCtrl.isloadingList.value == false ? Padding(
padding: EdgeInsetsGeometry.only(left: 25, right: 25),
child: ListView.builder(
padding: EdgeInsets.only(top: 8, bottom: 8),
physics: const BouncingScrollPhysics(),
itemBuilder: ((BuildContext context, int index) {
var item = tankListCtrl.tankList[index];
return Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.blue.withValues(alpha: 0.2),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
),
boxShadow: [
BoxShadow(
color: Colors.grey.withValues(
alpha: 0.7,
), // Die Farbe des Schattens
spreadRadius:
2, // Wie weit sich der Schatten ausbreitet
blurRadius:
3, // Wie stark der Schatten verschwommen ist
offset: const Offset(
0,
3,
), // Der Versatz des Schattens (x, y)
return PopScope(
canPop: false,
child: SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('Tankstops'),
centerTitle: true,
//backgroundColor: Colors.grey.shade600,
actions: [
IconButton(
icon: Icon(Icons.add_chart, color: Colors.grey.shade300),
onPressed: () async {
// Handle go to Chart View
tankListCtrl.goToChartView();
},
),
IconButton(
icon: Icon(Icons.logout, color: Colors.grey.shade300),
onPressed: () async {
// Handle logout logic here
tankListCtrl.logoutSessionAndGoToLoginPage();
},
),
],
),
floatingActionButton: Column(
mainAxisAlignment: MainAxisAlignment
.end, // Positioniere die Buttons am unteren Ende
crossAxisAlignment: CrossAxisAlignment.end, // Richte sie rechts aus
mainAxisSize: MainAxisSize.min, // Nimm nur den benötigten Platz ein
children: [
FloatingActionButton(
onPressed: () => tankListCtrl.goToInputPage(),
backgroundColor: Colors.blue,
child: Icon(Icons.add),
),
],
),
body: Obx(() => tankListCtrl.isloadingList.value == false
? Padding(
padding: EdgeInsetsGeometry.only(left: 25, right: 25),
child: ListView.builder(
padding: EdgeInsets.only(top: 8, bottom: 8),
physics: const BouncingScrollPhysics(),
itemBuilder: ((BuildContext context, int index) {
var item = tankListCtrl.tankList[index];
return Column(
children: [
Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.blue.withValues(
alpha: 0.35,
), // Die Farbe des Schattens
spreadRadius:
1, // Wie weit sich der Schatten ausbreitet
blurRadius:
1, // Wie stark der Schatten verschwommen ist
offset: const Offset(
0,
3,
), // Der Versatz des Schattens (x, y)
),
],
),
child: MyListTileItem(listItem: item),
),
SizedBox(height: 15),
],
),
child: MyListTileItem(listItem: item),
),
SizedBox(height: 15),
],
);
}),
itemCount: tankListCtrl.tankList.length,
),
):Center(
child: CircularProgressIndicator(
color: Colors.blue,
),
)
);
}),
itemCount: tankListCtrl.tankList.length,
),
)
: Center(
child: CircularProgressIndicator(
color: Colors.blue,
),
)),
),
),
);