add pdf print from all stops in actual year
This commit is contained in:
@@ -8,6 +8,7 @@ import '../../data/models/tank_model.dart';
|
||||
import '../../data/repository/appwrite_repository.dart';
|
||||
import '../../pages/tank/tank_view.dart';
|
||||
import '../../pages/gaslist/gaslist_view.dart';
|
||||
import '../print/print_view.dart';
|
||||
|
||||
class TanklistController extends GetxController {
|
||||
final _dataBox = GetStorage('MyUserStorage');
|
||||
@@ -164,4 +165,15 @@ class TanklistController extends GetxController {
|
||||
await Get.offAndToNamed(GaslistPage.namedRoute);
|
||||
|
||||
}
|
||||
|
||||
void goToPrintView() {
|
||||
|
||||
List<Map<String, dynamic>> tankMap = rxTankListActualYear.map((e) => e.toMap()).toList();
|
||||
Get.offAndToNamed(PrintPage.namedRoute, arguments: {
|
||||
'tankList': tankMap,
|
||||
'year': szRxYear.value,
|
||||
'summeLiter': szRxSummeYearLiter.value,
|
||||
'summePreis': szRxSummePrice.value,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,14 @@ class TanklistPage extends GetView<TanklistController> {
|
||||
tankListCtrl.goToGasView();
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.print,
|
||||
color: Colors.grey.shade300),
|
||||
onPressed: () async {
|
||||
// Handle go to Chart View
|
||||
tankListCtrl.goToPrintView();
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.logout, color: Colors.grey.shade300),
|
||||
onPressed: () async {
|
||||
@@ -140,12 +148,11 @@ class TanklistPage extends GetView<TanklistController> {
|
||||
);
|
||||
}),
|
||||
itemCount: tankListCtrl.rxTankListActualYear.length,
|
||||
):Expanded(child: Center(
|
||||
): Center(
|
||||
child: Text('Keine Einträge für das aktuelle Jahr vorhanden',
|
||||
style: TextStyle(
|
||||
fontSize: 18, color: Colors.grey.shade600)),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user