add payment
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/pdf_screen.dart';
|
||||
import 'package:fcs/pages/widgets/popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -200,13 +201,8 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
|
||||
return PopupMenuButton<PopupMenu>(
|
||||
elevation: 3.2,
|
||||
icon: Icon(Icons.more_vert, color: primaryColor),
|
||||
tooltip: 'This is tooltip',
|
||||
onSelected: (choice) {
|
||||
print(choice.id);
|
||||
if (choice.id == 1) {
|
||||
} else if (choice.id == 2) {
|
||||
} else if (choice.id == 3) {
|
||||
} else if (choice.id == 4) {}
|
||||
_showPDF(choice.id);
|
||||
},
|
||||
itemBuilder: (BuildContext context) {
|
||||
return menuPopup.map((PopupMenu choice) {
|
||||
@@ -252,4 +248,39 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_showPDF(int id) async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
var reportName = "";
|
||||
if (id == 1) {
|
||||
reportName = "commercial_invoice";
|
||||
} else if (id == 2) {
|
||||
reportName = "packing_list";
|
||||
} else if (id == 3) {
|
||||
reportName = "dms";
|
||||
} else if (id == 4) {
|
||||
reportName = "manifest";
|
||||
}
|
||||
_fcsShipment.reportName = reportName;
|
||||
|
||||
FcsShipmentModel fcsShipmentModel =
|
||||
Provider.of<FcsShipmentModel>(context, listen: false);
|
||||
String url = await fcsShipmentModel.report(_fcsShipment);
|
||||
Navigator.of(context).push(CupertinoPageRoute(
|
||||
builder: (context) => PDFScreen(
|
||||
title: "",
|
||||
url: url,
|
||||
)));
|
||||
// Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user