insert invoice pages
This commit is contained in:
@@ -519,6 +519,12 @@
|
||||
"package.title":"PACKAGES",
|
||||
"package.new":"New Package",
|
||||
"package.edit.title":"PACKAGE",
|
||||
"package.arrival.date":"Arrival Date",
|
||||
"package.number":"Package Number",
|
||||
"package.rate":"Rate",
|
||||
"package.weight":"Weight",
|
||||
"package.amount":"Amount",
|
||||
|
||||
|
||||
"pickup.date": "Pickup Date",
|
||||
|
||||
@@ -530,6 +536,10 @@
|
||||
|
||||
"invoices.btn": "Invoices",
|
||||
"invoices.title": "INVOICES",
|
||||
"invoices.add":"New Invoice",
|
||||
"invoice.form.title":"INVOICE",
|
||||
"invoice.payment":"Payment Receipt",
|
||||
"invoice.add_package":"Add Package",
|
||||
|
||||
"term":"TERMS"
|
||||
}
|
||||
@@ -498,23 +498,24 @@
|
||||
"announcement.desc":"ဖော်ပြချက်",
|
||||
|
||||
"login": "SignIn",
|
||||
"login.title":"Sign in to FCS",
|
||||
"login.phone":"Enter phone number",
|
||||
"login.title":"FCS သို့အကောင့်ဒ်၀င်ပါ",
|
||||
"login.phone":"ဖုန်းနံပါတ်ထည့်ပါ",
|
||||
"login.smscode.retry":"Resend again in {0} seconds",
|
||||
|
||||
"singup.verify.title":"Verify your number",
|
||||
"singup.verify.title":"သင့်နံပါတ်ကိုအတည်ပြုပါ",
|
||||
"singup.code_sent":"Enter 6 digit sms code sent to",
|
||||
"singup.resend":"Resend",
|
||||
"singup.resend":"ပြန်ပို့ရန်",
|
||||
|
||||
"user_edit.welcome":"Welcome to FCS",
|
||||
"user_edit.name":"Please enter your name",
|
||||
"user_edit.welcome":"FCS မှကြိုဆိုပါသည်",
|
||||
"user_edit.name":"ကျေးဇူးပြု၍ နာမည်ထည့်ပေးပါ",
|
||||
"user.phone":"My phone number",
|
||||
"user.fcs_id":"My FCS_ID",
|
||||
"user.shipping_address":"My USA shipping address",
|
||||
"user.deliveryAddress":"My delivery address",
|
||||
"user.buying_instruction":"See below instructions to add shipping address",
|
||||
|
||||
"buy_online":"Buying online",
|
||||
"buy_online":"အွန်လိုင်း မှဝယ်ယူခြင်း",
|
||||
"buy_online.title":"အွန်လိုင်း မှဝယ်ယူခြင်း",
|
||||
"buy.amazon":"Amazon",
|
||||
"buy.newegg":"Newegg",
|
||||
"buy.macy":"Macy",
|
||||
@@ -522,23 +523,51 @@
|
||||
|
||||
"notifications.title":"Notifications",
|
||||
|
||||
"staff.title":"FCS staffs",
|
||||
"staff.list.title":"FCS STAFFS",
|
||||
"staff.title":"FCS ဝန်ထမ်းများ",
|
||||
"staff.list.title":"FCS ဝန်ထမ်းများ",
|
||||
"staff.new":"New Staff",
|
||||
"staff.form.title":"FCS STAFF",
|
||||
"staff.add":"Add",
|
||||
"staff.update":"Update",
|
||||
|
||||
"shipment.title":"Shipments",
|
||||
"shipment.list.title":"SHIPMENTS",
|
||||
"shipment.title":"တင်ပို့ခြင်းများ",
|
||||
"shipment.list.title":"တင်ပို့ခြင်းများ",
|
||||
"shipment.add":"New shipment",
|
||||
"shipment.form.title":"SHIPMENT",
|
||||
"shipment.number":"Shipment number",
|
||||
|
||||
|
||||
"package.name":"Packages",
|
||||
"package.title":"PACKAGES",
|
||||
"package.new":"New Package",
|
||||
"package.edit.title":"PACKAGE",
|
||||
"package.arrival.date":"Arrival Date",
|
||||
"package.number":"Package Number",
|
||||
"package.rate":"Rate",
|
||||
"package.weight":"Weight",
|
||||
"package.amount":"Amount",
|
||||
|
||||
"pickup": "Pickups",
|
||||
"pickup.title": "Pickups",
|
||||
"pickup.new": "New Pickup",
|
||||
"pickup.edit.title": "PICKUP",
|
||||
"pickup.date": "Pickup Date",
|
||||
|
||||
"rate":"အဆင့်သတ်မှတ်ချက်များ",
|
||||
"rate.title":"အဆင့်သတ်မှတ်ချက်များ",
|
||||
|
||||
"message.btn":"မက်ဆေ့ခ်ျများ",
|
||||
"message.title":"မက်ဆေ့ခ်ျများ",
|
||||
|
||||
"customers.btn": "ဝယ်ယူသူများ",
|
||||
"customers.title": "ဝယ်ယူသူများ",
|
||||
|
||||
"invoices.btn": "ငွေတောင်းခံလွှာများ",
|
||||
"invoices.title": "ငွေတောင်းခံလွှာများ",
|
||||
"invoices.add":"New Invoice",
|
||||
"invoice.form.title":"INVOICE",
|
||||
"invoice.payment":"Payment Receipt",
|
||||
"invoice.add_package":"Add Package",
|
||||
|
||||
"term":"TERMS"
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import 'model/chart_model.dart';
|
||||
import 'model/device_model.dart';
|
||||
import 'model/do_model.dart';
|
||||
import 'model/employee_model.dart';
|
||||
import 'model/invoice_model.dart';
|
||||
import 'model/language_model.dart';
|
||||
import 'model/log_model.dart';
|
||||
import 'model/main_model.dart';
|
||||
@@ -66,8 +67,8 @@ class _AppState extends State<App> {
|
||||
final PickUpModel pickUpModel = new PickUpModel();
|
||||
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
||||
final ShipmentModel shipmentModel = new ShipmentModel();
|
||||
final PackageModel packageModel=new PackageModel();
|
||||
|
||||
final PackageModel packageModel = new PackageModel();
|
||||
final InvoiceModel invoiceModel = new InvoiceModel();
|
||||
|
||||
AppTranslationsDelegate _newLocaleDelegate;
|
||||
|
||||
@@ -102,7 +103,8 @@ class _AppState extends State<App> {
|
||||
..addModel(shipmentRateModel)
|
||||
..addModel(shipmentModel)
|
||||
..addModel(packageModel)
|
||||
..addModel(shipmentRateModel);
|
||||
..addModel(shipmentRateModel)
|
||||
..addModel(invoiceModel);
|
||||
this.mainModel.init();
|
||||
}
|
||||
|
||||
@@ -155,6 +157,7 @@ class _AppState extends State<App> {
|
||||
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
||||
ChangeNotifierProvider(builder: (context) => shipmentModel),
|
||||
ChangeNotifierProvider(builder: (context) => packageModel),
|
||||
ChangeNotifierProvider(builder: (context) => invoiceModel),
|
||||
ChangeNotifierProvider(
|
||||
builder: (context) => testModel,
|
||||
),
|
||||
|
||||
150
lib/model/invoice_model.dart
Normal file
150
lib/model/invoice_model.dart
Normal file
@@ -0,0 +1,150 @@
|
||||
import 'package:fcs/vo/invoice.dart';
|
||||
import 'package:fcs/vo/package.dart';
|
||||
|
||||
import 'base_model.dart';
|
||||
|
||||
class InvoiceModel extends BaseModel {
|
||||
List<Invoice> invoices = [
|
||||
Invoice(
|
||||
invoiceNumber: 'INV202004050010',
|
||||
invoiceDate: DateTime(2020, 4, 5, 12, 30),
|
||||
customerName: 'Ko Nyi',
|
||||
customerPhoneNumber: '+959 888888888',
|
||||
amount: 5000,
|
||||
status: 'Pending',
|
||||
packages: [
|
||||
Package(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "3",
|
||||
boxNumber: "1",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 25,
|
||||
status: "Received",
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
),
|
||||
Package(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "3",
|
||||
boxNumber: "2",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 20,
|
||||
status: "Received",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||
]),
|
||||
Invoice(
|
||||
invoiceNumber: 'INV202004050011',
|
||||
invoiceDate: DateTime(2020, 4, 5, 9, 30),
|
||||
customerName: 'Ko Aung Myo',
|
||||
customerPhoneNumber: '+959 444444444',
|
||||
amount: 3000,
|
||||
status: 'Paid',
|
||||
packages: [
|
||||
Package(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "3",
|
||||
boxNumber: "3",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 15,
|
||||
status: "Received",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||
Package(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "2",
|
||||
boxNumber: "1",
|
||||
rate: 8,
|
||||
packageType: "Medicine",
|
||||
weight: 15,
|
||||
status: "Processing",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
||||
]),
|
||||
Invoice(
|
||||
invoiceNumber: 'INV202004060010',
|
||||
invoiceDate: DateTime(2020, 4, 6, 10, 10),
|
||||
customerName: 'Ko Zaw Thu',
|
||||
customerPhoneNumber: '+959 777777777',
|
||||
amount: 2000,
|
||||
status: 'Paid',
|
||||
packages: [
|
||||
Package(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "2",
|
||||
boxNumber: "2",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 55,
|
||||
status: "Ready to ship",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'),
|
||||
Package(
|
||||
shipmentNumber: "A201",
|
||||
receiverNumber: "1",
|
||||
boxNumber: "1",
|
||||
rate: 9,
|
||||
packageType: "Dangerous",
|
||||
weight: 25,
|
||||
status: "Delivered",
|
||||
arrivedDate: DateTime(2020, 5, 21),
|
||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||
]),
|
||||
Invoice(
|
||||
invoiceNumber: 'INV202004060011',
|
||||
invoiceDate: DateTime(2020, 4, 6, 12, 15),
|
||||
customerName: 'Ko Myo Min',
|
||||
customerPhoneNumber: '+959 555555555',
|
||||
amount: 3000,
|
||||
status: 'Pending',
|
||||
packages: [
|
||||
Package(
|
||||
shipmentNumber: "A201",
|
||||
receiverNumber: "1",
|
||||
boxNumber: "1",
|
||||
rate: 9,
|
||||
packageType: "Dangerous",
|
||||
weight: 25,
|
||||
status: "Delivered",
|
||||
arrivedDate: DateTime(2020, 5, 21),
|
||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||
Package(
|
||||
shipmentNumber: "A201",
|
||||
receiverNumber: "1",
|
||||
boxNumber: "2",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 5,
|
||||
status: "Delivered",
|
||||
arrivedDate: DateTime(2020, 5, 21),
|
||||
receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'),
|
||||
])
|
||||
];
|
||||
|
||||
List<Invoice> get pending {
|
||||
List<Invoice> _i = invoices.where((e) => e.status == "Pending").toList()
|
||||
..sort((e1, e2) {
|
||||
return e2.invoiceNumber.compareTo(e1.invoiceNumber);
|
||||
});
|
||||
return _i;
|
||||
}
|
||||
|
||||
List<Invoice> get paided {
|
||||
return invoices.where((e) => e.status == "Paid").toList()
|
||||
..sort((e1, e2) {
|
||||
return e2.invoiceNumber.compareTo(e1.invoiceNumber);
|
||||
});
|
||||
}
|
||||
|
||||
void initUser(user) {
|
||||
super.initUser(user);
|
||||
}
|
||||
|
||||
@override
|
||||
logout() async {
|
||||
invoices = [];
|
||||
}
|
||||
}
|
||||
@@ -23,13 +23,11 @@ class LanguageModel extends BaseModel {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
logout() async {
|
||||
}
|
||||
logout() async {}
|
||||
|
||||
Future<String> load() async {
|
||||
var data =await SharedPref.getLang();
|
||||
var data = await SharedPref.getLang();
|
||||
if (data == null) return languagesList[1];
|
||||
return data;
|
||||
}
|
||||
@@ -37,7 +35,7 @@ class LanguageModel extends BaseModel {
|
||||
void saveLanguage(String language) async {
|
||||
Translation().onLocaleChanged(Locale(languagesMap[language]));
|
||||
|
||||
SharedPref.saveLang(language);
|
||||
// SharedPref.saveLang(language);
|
||||
this.language = language;
|
||||
this.isEng = this.language == "English";
|
||||
notifyListeners();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:fcs/pages/util.dart';
|
||||
import 'package:fcs/vo/manual.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
@@ -68,13 +69,10 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => InstructionPage(
|
||||
name: 'Amazon',
|
||||
image: "assets/amazon_ins.png",
|
||||
)));
|
||||
Navigator.of(context).push(BottomUpPageRoute(InstructionPage(
|
||||
name: 'Amazon',
|
||||
image: "assets/amazon_ins.png",
|
||||
)));
|
||||
},
|
||||
child: LocalText(
|
||||
context,
|
||||
@@ -102,12 +100,8 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ManualPage(
|
||||
marketplace: 'Newegg',
|
||||
)));
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(ManualPage(marketplace: 'Newegg')));
|
||||
},
|
||||
child: LocalText(
|
||||
context,
|
||||
@@ -135,12 +129,8 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ManualPage(
|
||||
marketplace: "Macy",
|
||||
)));
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(ManualPage(marketplace: 'Macy')));
|
||||
},
|
||||
child: LocalText(
|
||||
context,
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:async';
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/model/shared_pref.dart';
|
||||
import 'package:fcs/vo/user.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -191,10 +192,7 @@ class _CodePageState extends State<CodePage> {
|
||||
|
||||
_verify() async {
|
||||
Provider.of<MainModel>(context).saveUser(pin, widget.phoneNumber);
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => UserEditPage()),
|
||||
);
|
||||
await Navigator.of(context).push(BottomUpPageRoute(UserEditPage()));
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/pages/shipment_list.dart';
|
||||
import 'package:fcs/pages_fcs/package_list.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/localization/transalation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
@@ -46,6 +47,7 @@ import '../theme/theme.dart';
|
||||
import 'announcement_list.dart';
|
||||
import 'buying_online.dart';
|
||||
import 'do/do_list.dart';
|
||||
import 'invoice/invoce_list.dart';
|
||||
import 'my_registeration.dart';
|
||||
import 'pd/pd_list.dart';
|
||||
import 'products_list.dart';
|
||||
@@ -160,7 +162,7 @@ class _HomePageState extends State<HomePage> {
|
||||
final invoicesBtn = _buildBtn2("invoices.btn",
|
||||
icon: FontAwesomeIcons.fileInvoice,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
||||
Navigator.of(context).push(BottomUpPageRoute(InvoiceList())));
|
||||
|
||||
List<Widget> widgets = [];
|
||||
widgets.add(buyingBtn);
|
||||
@@ -237,11 +239,8 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SigninPage()),
|
||||
);
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(SigninPage()));
|
||||
},
|
||||
// iconSize: 30,
|
||||
child: Text(
|
||||
@@ -312,6 +311,8 @@ class _HomePageState extends State<HomePage> {
|
||||
}
|
||||
|
||||
_langChange(index) {
|
||||
var languageModel = Provider.of<LanguageModel>(context);
|
||||
languageModel.saveLanguage(Translation().supportedLanguages[index]);
|
||||
setState(() {
|
||||
isSelected.asMap().forEach((i, e) {
|
||||
isSelected[i] = false;
|
||||
|
||||
158
lib/pages/invoice/invoce_list.dart
Normal file
158
lib/pages/invoice/invoce_list.dart
Normal file
@@ -0,0 +1,158 @@
|
||||
import 'package:fcs/model/invoice_model.dart';
|
||||
import 'package:fcs/model/shipment_model.dart';
|
||||
import 'package:fcs/model_fcs/package_model.dart';
|
||||
import 'package:fcs/pages_fcs/package_list_row.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/pages/search_page.dart';
|
||||
import 'package:fcs/vo/buyer.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../shipment_editor.dart';
|
||||
import '../shipment_list_row.dart';
|
||||
import 'invoice_editor.dart';
|
||||
import 'invoice_list_row.dart';
|
||||
|
||||
class InvoiceList extends StatefulWidget {
|
||||
@override
|
||||
_InvoiceListState createState() => _InvoiceListState();
|
||||
}
|
||||
|
||||
class _InvoiceListState extends State<InvoiceList> {
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: DefaultTabController(
|
||||
length: 3,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(context, 'invoices.title',
|
||||
color: Colors.white, fontSize: 20),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
iconSize: 30,
|
||||
onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
],
|
||||
bottom: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
tabs: [
|
||||
Tab(text: "Packages"),
|
||||
Tab(text: "Pending"),
|
||||
Tab(text: "Paid"),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
_newInvoice();
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(AppTranslations.of(context).text("invoices.add")),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [_packages(), _pending(), _paided()],
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_newInvoice() {
|
||||
Navigator.of(context).push(BottomUpPageRoute(InvoiceEditor()));
|
||||
}
|
||||
|
||||
Widget _packages() {
|
||||
var packageModel = Provider.of<PackageModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new ListView.separated(
|
||||
separatorBuilder: (context, index) => Divider(
|
||||
color: Colors.black,
|
||||
),
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: packageModel.completed.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PackageListRow(
|
||||
package: packageModel.completed[index],
|
||||
isReadOnly: true,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _pending() {
|
||||
var invoiceModel = Provider.of<InvoiceModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new ListView.separated(
|
||||
separatorBuilder: (context, index) => Divider(
|
||||
color: Colors.black,
|
||||
),
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: invoiceModel.pending.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InvoiceListRow(invoice: invoiceModel.pending[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _paided() {
|
||||
var invoiceModel = Provider.of<InvoiceModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new ListView.separated(
|
||||
separatorBuilder: (context, index) => Divider(
|
||||
color: Colors.black,
|
||||
),
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: invoiceModel.paided.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InvoiceListRow(invoice: invoiceModel.paided[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
380
lib/pages/invoice/invoice_editor.dart
Normal file
380
lib/pages/invoice/invoice_editor.dart
Normal file
@@ -0,0 +1,380 @@
|
||||
import 'package:fcs/pages/invoice/package_addition.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/vo/invoice.dart';
|
||||
import 'package:fcs/vo/package.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:fcs/widget/multi_img_controller.dart';
|
||||
import 'package:fcs/widget/multi_img_file.dart';
|
||||
import 'package:fcs/widget/my_data_table.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../util.dart';
|
||||
|
||||
class InvoiceEditor extends StatefulWidget {
|
||||
final Invoice invoice;
|
||||
InvoiceEditor({this.invoice});
|
||||
|
||||
@override
|
||||
_InvoiceEditorState createState() => _InvoiceEditorState();
|
||||
}
|
||||
|
||||
class _InvoiceEditorState extends State<InvoiceEditor> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
TextEditingController _invoiceNumberController = new TextEditingController();
|
||||
TextEditingController _dateController = new TextEditingController();
|
||||
TextEditingController _nameController = new TextEditingController();
|
||||
TextEditingController _phoneController = new TextEditingController();
|
||||
TextEditingController _discountController = new TextEditingController();
|
||||
TextEditingController _amountController = new TextEditingController();
|
||||
TextEditingController _statusController = new TextEditingController();
|
||||
MultiImgController multiImgController = MultiImgController();
|
||||
|
||||
Invoice _invoice;
|
||||
bool _isLoading = false;
|
||||
List<Package> _packages = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.invoice != null) {
|
||||
_invoice = widget.invoice;
|
||||
_invoiceNumberController.text = _invoice.invoiceNumber;
|
||||
_dateController.text = dateFormatter.format(_invoice.invoiceDate);
|
||||
_nameController.text = _invoice.customerName;
|
||||
_phoneController.text = _invoice.customerPhoneNumber;
|
||||
_amountController.text = _invoice.amount.toString();
|
||||
_statusController.text = _invoice.status.toString();
|
||||
_packages = _invoice.packages;
|
||||
} else {
|
||||
_packages = [
|
||||
Package(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "3",
|
||||
boxNumber: "1",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 25,
|
||||
status: "Received",
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
),
|
||||
Package(
|
||||
shipmentNumber: "A202",
|
||||
receiverNumber: "3",
|
||||
boxNumber: "2",
|
||||
rate: 7,
|
||||
packageType: "General",
|
||||
weight: 20,
|
||||
status: "Received",
|
||||
arrivedDate: DateTime(2020, 6, 1),
|
||||
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(context, 'invoice.form.title',
|
||||
color: Colors.white, fontSize: 20),
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(children: <Widget>[
|
||||
fcsInput('Invoice Date', Icons.date_range,
|
||||
controller: _dateController),
|
||||
widget.invoice == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: TextFormField(
|
||||
controller: _invoiceNumberController,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Invoice Number',
|
||||
labelStyle:
|
||||
TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
icon: Icon(
|
||||
Icons.pages,
|
||||
color: Colors.grey,
|
||||
),
|
||||
)),
|
||||
),
|
||||
widget.invoice == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: TextFormField(
|
||||
initialValue: "U Nyi",
|
||||
cursorColor: primaryColor,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Customer Name',
|
||||
labelStyle:
|
||||
TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey, width: 1.0)),
|
||||
icon: Icon(
|
||||
Icons.account_box,
|
||||
color: Colors.grey,
|
||||
),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.grey,
|
||||
),
|
||||
onPressed: () {})),
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
widget.invoice == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: TextFormField(
|
||||
controller: _nameController,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Customer Name',
|
||||
labelStyle:
|
||||
TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
icon: Icon(
|
||||
Icons.account_box,
|
||||
color: Colors.grey,
|
||||
),
|
||||
)),
|
||||
),
|
||||
widget.invoice == null
|
||||
? Container()
|
||||
: TextFormField(
|
||||
controller: _phoneController,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Customer Phone Number',
|
||||
labelStyle:
|
||||
TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
icon: Icon(
|
||||
Icons.phone,
|
||||
color: Colors.grey,
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
child: fcsInput('Amount', FontAwesomeIcons.moneyBill,
|
||||
controller: _amountController),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Discount', FontAwesomeIcons.tag,
|
||||
controller: _discountController),
|
||||
),
|
||||
widget.invoice == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: TextFormField(
|
||||
controller: _statusController,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Status',
|
||||
filled: true,
|
||||
icon: Image.asset(
|
||||
'assets/status.png',
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
ExpansionTile(
|
||||
title: Text('Payment Attachment'),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20),
|
||||
child: Row(children: <Widget>[
|
||||
LocalText(
|
||||
context,
|
||||
"invoice.payment",
|
||||
color: Colors.grey,
|
||||
fontSize: 14,
|
||||
),
|
||||
MultiImageFile(
|
||||
enabled: true,
|
||||
controller: multiImgController,
|
||||
title: "Receipt File",
|
||||
)
|
||||
])),
|
||||
SizedBox(
|
||||
height: 25,
|
||||
),
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
title: Text('Package Informations'),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: MyDataTable(
|
||||
headingRowHeight: 40,
|
||||
columnSpacing: 20,
|
||||
columns: [
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"package.number",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"package.rate",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"package.weight",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"package.amount",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
rows: getPackageRow(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: FloatingActionButton.extended(
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(AppTranslations.of(context)
|
||||
.text("invoice.add_package")),
|
||||
backgroundColor: primaryColor,
|
||||
onPressed: () {
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(PackageAddition()));
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 25),
|
||||
],
|
||||
),
|
||||
]),
|
||||
)),
|
||||
widget.invoice == null
|
||||
? Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Create invoice'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
)))
|
||||
: Container(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Save invoice'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
))),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<MyDataRow> getPackageRow(BuildContext context) {
|
||||
return _packages.map((p) {
|
||||
return MyDataRow(
|
||||
onSelectChanged: (bool selected) {},
|
||||
cells: [
|
||||
MyDataCell(new Text(
|
||||
p.packageNumber == null ? "" : p.packageNumber,
|
||||
style: textStyle,
|
||||
)),
|
||||
MyDataCell(
|
||||
new Text(p.rate.toString(), style: textStyle),
|
||||
),
|
||||
MyDataCell(
|
||||
new Text("${p.weight.toString()} lb", style: textStyle),
|
||||
),
|
||||
MyDataCell(
|
||||
new Text(p.price == null ? "" : "\$ " + p.price.toString(),
|
||||
style: textStyle),
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
96
lib/pages/invoice/invoice_list_row.dart
Normal file
96
lib/pages/invoice/invoice_list_row.dart
Normal file
@@ -0,0 +1,96 @@
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/vo/invoice.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../util.dart';
|
||||
import 'invoice_editor.dart';
|
||||
|
||||
class InvoiceListRow extends StatefulWidget {
|
||||
final Invoice invoice;
|
||||
const InvoiceListRow({this.invoice});
|
||||
|
||||
@override
|
||||
_InvoiceListRowState createState() => _InvoiceListRowState();
|
||||
}
|
||||
|
||||
class _InvoiceListRowState extends State<InvoiceListRow> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final double dotSize = 15.0;
|
||||
Invoice _invoice = new Invoice();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
if (widget.invoice != null) {
|
||||
_invoice = widget.invoice;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(InvoiceEditor(invoice: _invoice)));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 5, right: 10),
|
||||
child: Icon(
|
||||
FontAwesomeIcons.fileInvoice,
|
||||
color: primaryColor,
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
new Expanded(
|
||||
child: new Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
_invoice.invoiceNumber == null
|
||||
? ''
|
||||
: _invoice.invoiceNumber,
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
||||
child: new Text(
|
||||
dateFormatter.format(_invoice.invoiceDate),
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: getStatus(_invoice.status),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
107
lib/pages/invoice/package_addition.dart
Normal file
107
lib/pages/invoice/package_addition.dart
Normal file
@@ -0,0 +1,107 @@
|
||||
import 'package:fcs/model_fcs/package_model.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/vo/package.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PackageAddition extends StatefulWidget {
|
||||
final Package package;
|
||||
PackageAddition({this.package});
|
||||
|
||||
@override
|
||||
_PackageAdditionState createState() => _PackageAdditionState();
|
||||
}
|
||||
|
||||
class _PackageAdditionState extends State<PackageAddition> {
|
||||
Package _package = new Package();
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.package != null) {
|
||||
_package = widget.package;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var packageModel = Provider.of<PackageModel>(context);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("package.edit.title")),
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(children: <Widget>[
|
||||
DropdownButtonFormField(
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Package Number',
|
||||
icon: Icon(Icons.pages)),
|
||||
items: packageModel.completed
|
||||
.map((e) => DropdownMenuItem(
|
||||
child: Text(e.packageNumber), value: e))
|
||||
.toList(),
|
||||
onChanged: (map) => {},
|
||||
),
|
||||
]),
|
||||
)),
|
||||
widget.package == null
|
||||
? Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Add package'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
)))
|
||||
: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Save package'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
))),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
141
lib/pages/invoice/package_info.dart
Normal file
141
lib/pages/invoice/package_info.dart
Normal file
@@ -0,0 +1,141 @@
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/model/pickup_model.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/vo/package.dart';
|
||||
import 'package:fcs/widget/label_widgets.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PackageInfo extends StatefulWidget {
|
||||
final Package package;
|
||||
PackageInfo({this.package});
|
||||
|
||||
@override
|
||||
_PackageInfoState createState() => _PackageInfoState();
|
||||
}
|
||||
|
||||
class _PackageInfoState extends State<PackageInfo> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
Package _package;
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.package != null) {
|
||||
_package = widget.package;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("package.edit.title")),
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(Icons.calendar_today,),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0, left: 15),
|
||||
child: labeledText(
|
||||
context,
|
||||
dateFormatter.format(_package.arrivedDate),
|
||||
"package.arrival.date"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(Icons.pages),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0, left: 15),
|
||||
child: labeledText(context, _package.packageNumber,
|
||||
"package.number"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(FontAwesomeIcons.weightHanging),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0, left: 15),
|
||||
child: labeledText(
|
||||
context,
|
||||
"${_package.weight.toString()} lb",
|
||||
"package.weight"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(FontAwesomeIcons.tag),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0, left: 15),
|
||||
child: labeledText(context, _package.rate.toString(),
|
||||
"package.rate"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(FontAwesomeIcons.moneyBill),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0, left: 15),
|
||||
child: labeledText(
|
||||
context,
|
||||
_package.price == null
|
||||
? ""
|
||||
: "\$ " + _package.price.toString(),
|
||||
"package.amount"),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
_shipmentNumberController.text,
|
||||
style: TextStyle(
|
||||
color: Colors.black87,
|
||||
fontSize: 16,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
@@ -155,24 +155,6 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentModel = Provider.of<ShipmentModel>(context);
|
||||
|
||||
final statusBox = Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: TextFormField(
|
||||
maxLines: null,
|
||||
controller: _statusController,
|
||||
cursorColor: primaryColor,
|
||||
style: textStyle,
|
||||
decoration: new InputDecoration(
|
||||
labelText: 'Status',
|
||||
labelStyle: TextStyle(fontSize: 14, color: Colors.grey),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
),
|
||||
));
|
||||
|
||||
MainModel mainModel = Provider.of<MainModel>(context);
|
||||
|
||||
final commercialBtn = Container(
|
||||
@@ -183,7 +165,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Download commercial invoice'),
|
||||
child: Text('Download Commercial Invoice'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
@@ -201,7 +183,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Download packing list'),
|
||||
child: Text('Download Packing List'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
@@ -237,7 +219,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Create'),
|
||||
child: Text('Create Shipment'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
@@ -254,7 +236,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
child: Container(
|
||||
width: 250,
|
||||
child: FlatButton(
|
||||
child: Text('Update'),
|
||||
child: Text('Update Shipment'),
|
||||
color: primaryColor,
|
||||
textColor: Colors.white,
|
||||
onPressed: () {
|
||||
@@ -282,76 +264,117 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(children: <Widget>[
|
||||
_showCustomerData(mainModel.customer),
|
||||
// _showCustomerData(mainModel.customer),
|
||||
widget.shipment == null
|
||||
? fcsInput('Shipment number', Icons.text_rotation_none,
|
||||
? fcsInput('Shipment Number', Icons.text_rotation_none,
|
||||
controller: _shipmentNumberController)
|
||||
: Container(),
|
||||
: Container(
|
||||
child: TextFormField(
|
||||
controller: _shipmentNumberController,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Shipment Number',
|
||||
labelStyle:
|
||||
TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
icon: Icon(
|
||||
Icons.text_rotation_none,
|
||||
color: Colors.grey,
|
||||
),
|
||||
)),
|
||||
),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: fcsInput('Cutoff date', Icons.date_range,
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Cutoff Date', Icons.date_range,
|
||||
controller: _cutoffDateController),
|
||||
)
|
||||
: Container(),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: showShipmentTypes(context, shipmentModel))
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: DropdownButtonFormField(
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Shipment Type',
|
||||
icon: Icon(Icons.pages)),
|
||||
items: shipmentModel.shipmentType
|
||||
.map((e) =>
|
||||
DropdownMenuItem(child: Text(e), value: e))
|
||||
.toList(),
|
||||
onChanged: (selected) => {
|
||||
setState(() {
|
||||
_currentShipment = selected;
|
||||
})
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: fcsInput('Arrival date', Icons.date_range,
|
||||
padding:
|
||||
EdgeInsets.only(top: widget.shipment == null ? 5 : 0),
|
||||
child: fcsInput('Arrival Date', Icons.date_range,
|
||||
controller: _arrivalDateController),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: fcsInput('Departure date', Icons.date_range,
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Departure Date', Icons.date_range,
|
||||
controller: _departureDateControler),
|
||||
),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Consignee', Icons.work,
|
||||
controller: _consigneeController),
|
||||
)
|
||||
: Container(),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput(
|
||||
'Port of loading', FontAwesomeIcons.ship,
|
||||
'Port of Loading', FontAwesomeIcons.ship,
|
||||
controller: _portController),
|
||||
)
|
||||
: Container(),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: fcsInput('Final destination',
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Final Destination',
|
||||
MaterialCommunityIcons.location_enter,
|
||||
controller: _destinationController),
|
||||
)
|
||||
: Container(),
|
||||
widget.shipment == null
|
||||
? Container()
|
||||
: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 15, right: 8.0),
|
||||
child: Image.asset(
|
||||
'assets/status.png',
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
),
|
||||
Expanded(child: statusBox)
|
||||
],
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: TextFormField(
|
||||
controller: _statusController,
|
||||
cursorColor: primaryColor,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Status',
|
||||
filled: true,
|
||||
labelStyle:
|
||||
TextStyle(fontSize: 16, color: Colors.grey),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey, width: 1.0)),
|
||||
icon: Image.asset(
|
||||
'assets/status.png',
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
)),
|
||||
),
|
||||
widget.shipment == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Remark', MaterialCommunityIcons.note,
|
||||
controller: _remarkController),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:fcs/model/shipment_model.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/pages/search_page.dart';
|
||||
@@ -84,10 +85,7 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
}
|
||||
|
||||
_newShipment() {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => new ShipmentEditor()),
|
||||
);
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentEditor()));
|
||||
}
|
||||
|
||||
Widget _upComing() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/vo/shipment.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -35,11 +36,8 @@ class _ShipmentListRowState extends State<ShipmentListRow> {
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ShipmentEditor(shipment: _shipment)),
|
||||
);
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(ShipmentEditor(shipment: _shipment)));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:country_code_picker/country_code_picker.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -162,11 +163,8 @@ class _SigninPageState extends State<SigninPage> {
|
||||
? phoneNumber.replaceFirst("0", "")
|
||||
: phoneNumber;
|
||||
phoneNumber = dialCode + phoneNumber;
|
||||
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => CodePage(phoneNumber: phoneNumber)));
|
||||
await Navigator.of(context)
|
||||
.push(BottomUpPageRoute(CodePage(phoneNumber: phoneNumber)));
|
||||
Navigator.pop(context);
|
||||
|
||||
if (exp != null) throw exp;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
@@ -47,10 +48,7 @@ class _StaffListState extends State<StaffList> {
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => StaffEditor()),
|
||||
);
|
||||
Navigator.of(context).push(BottomUpPageRoute(StaffEditor()));
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(AppTranslations.of(context).text("staff.new")),
|
||||
@@ -70,11 +68,8 @@ class _StaffListState extends State<StaffList> {
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StaffEditor(staff: user)),
|
||||
);
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(StaffEditor(staff: user)));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
|
||||
@@ -274,12 +274,30 @@ Widget getStatus(String status) {
|
||||
style: TextStyle(
|
||||
color: Colors.green, fontSize: 12),
|
||||
)
|
||||
: Chip(
|
||||
avatar: Icon(
|
||||
Icons.check,
|
||||
size: 14,
|
||||
),
|
||||
label: Text(status));
|
||||
: status == "Paid"
|
||||
? Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: Icon(Icons.check),
|
||||
),
|
||||
Text(
|
||||
status,
|
||||
style: TextStyle(
|
||||
color: primaryColor,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
status,
|
||||
style: TextStyle(
|
||||
color: primaryColor,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold),
|
||||
);
|
||||
}
|
||||
|
||||
call(BuildContext context, String phone) {
|
||||
@@ -386,70 +404,104 @@ Widget phoneWidget(BuildContext context, String phone) {
|
||||
|
||||
Widget fcsInput(String label, IconData iconData,
|
||||
{TextEditingController controller, String value}) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: Icon(iconData),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
textAlign: TextAlign.left,
|
||||
decoration: new InputDecoration(
|
||||
contentPadding: EdgeInsets.only(top: 8),
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(fontSize: 14, color: Colors.grey),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
),
|
||||
)),
|
||||
]),
|
||||
)),
|
||||
],
|
||||
);
|
||||
return TextFormField(
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
icon: Icon(
|
||||
iconData,
|
||||
color: Colors.grey,
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.grey, width: 1.0)),
|
||||
));
|
||||
// return Row(
|
||||
// children: <Widget>[
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(right: 8.0),
|
||||
// child: Icon(iconData),
|
||||
// ),
|
||||
// Expanded(
|
||||
// child: Container(
|
||||
// child: Row(children: <Widget>[
|
||||
// Expanded(
|
||||
// child: TextFormField(
|
||||
// initialValue: value,
|
||||
// controller: controller,
|
||||
// cursorColor: primaryColor,
|
||||
// maxLines: null,
|
||||
// minLines: 1,
|
||||
// textAlign: TextAlign.left,
|
||||
// decoration: new InputDecoration(
|
||||
// contentPadding: EdgeInsets.only(top: 8),
|
||||
// labelText: label,
|
||||
// labelStyle: TextStyle(fontSize: 14, color: Colors.grey),
|
||||
// enabledBorder: UnderlineInputBorder(
|
||||
// borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
// focusedBorder: UnderlineInputBorder(
|
||||
// borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
// ),
|
||||
// )),
|
||||
// ]),
|
||||
// )),
|
||||
// ],
|
||||
// );
|
||||
}
|
||||
|
||||
Widget fcsInputReadOnly(String label, IconData iconData,
|
||||
{TextEditingController controller, String value}) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: Icon(iconData),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
readOnly: true,
|
||||
textAlign: TextAlign.left,
|
||||
decoration: new InputDecoration(
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(top: 8),
|
||||
labelText: label,
|
||||
),
|
||||
)),
|
||||
]),
|
||||
)),
|
||||
],
|
||||
);
|
||||
return TextFormField(
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
border: InputBorder.none,
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
icon: Icon(
|
||||
iconData,
|
||||
color: Colors.grey,
|
||||
),
|
||||
));
|
||||
// return Row(
|
||||
// children: <Widget>[
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(right: 8.0),
|
||||
// child: Icon(iconData),
|
||||
// ),
|
||||
// Expanded(
|
||||
// child: Container(
|
||||
// child: Row(children: <Widget>[
|
||||
// Expanded(
|
||||
// child: TextFormField(
|
||||
// initialValue: value,
|
||||
// controller: controller,
|
||||
// cursorColor: primaryColor,
|
||||
// maxLines: null,
|
||||
// minLines: 1,
|
||||
// readOnly: true,
|
||||
// textAlign: TextAlign.left,
|
||||
// decoration: new InputDecoration(
|
||||
// border: InputBorder.none,
|
||||
// contentPadding: EdgeInsets.only(top: 8),
|
||||
// labelText: label,
|
||||
// ),
|
||||
// )),
|
||||
// ]),
|
||||
// )),
|
||||
// ],
|
||||
// );
|
||||
}
|
||||
|
||||
Widget fcsDropDown(String label, IconData iconData,
|
||||
|
||||
@@ -107,7 +107,10 @@ class _PackageListState extends State<PackageList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: packageModel.upcoming.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PackageListRow(package: packageModel.upcoming[index]);
|
||||
return PackageListRow(
|
||||
package: packageModel.upcoming[index],
|
||||
isReadOnly: false,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
@@ -128,7 +131,10 @@ class _PackageListState extends State<PackageList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: packageModel.completed.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PackageListRow(package: packageModel.completed[index]);
|
||||
return PackageListRow(
|
||||
package: packageModel.completed[index],
|
||||
isReadOnly: false,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import 'package:fcs/pages/invoice/package_info.dart';
|
||||
import 'package:fcs/pages/util.dart';
|
||||
import 'package:fcs/pages_fcs/package_editor.dart';
|
||||
import 'package:fcs/vo/package.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class PackageListRow extends StatefulWidget {
|
||||
final bool isReadOnly;
|
||||
final Package package;
|
||||
const PackageListRow({this.package});
|
||||
const PackageListRow({this.package, this.isReadOnly});
|
||||
|
||||
@override
|
||||
_PackageListRowtate createState() => _PackageListRowtate();
|
||||
@@ -29,11 +32,17 @@ class _PackageListRowtate extends State<PackageListRow> {
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => PackageEditor(package: _package)),
|
||||
);
|
||||
if (widget.isReadOnly) {
|
||||
Navigator.push(
|
||||
context,
|
||||
BottomUpPageRoute(PackageInfo(package: _package)),
|
||||
);
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
BottomUpPageRoute(PackageEditor(package: _package)),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
|
||||
24
lib/vo/invoice.dart
Normal file
24
lib/vo/invoice.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package.dart';
|
||||
|
||||
class Invoice {
|
||||
String invoiceNumber;
|
||||
DateTime invoiceDate;
|
||||
String customerName;
|
||||
String customerPhoneNumber;
|
||||
double amount;
|
||||
String discount;
|
||||
String status;
|
||||
String paymentAttachment;
|
||||
|
||||
List<Package> packages;
|
||||
Invoice(
|
||||
{this.invoiceNumber,
|
||||
this.invoiceDate,
|
||||
this.customerName,
|
||||
this.customerPhoneNumber,
|
||||
this.amount,
|
||||
this.discount,
|
||||
this.status,
|
||||
this.paymentAttachment,
|
||||
this.packages});
|
||||
}
|
||||
@@ -12,6 +12,7 @@ class Package {
|
||||
|
||||
int rate;
|
||||
int weight;
|
||||
int amount;
|
||||
String packageType;
|
||||
String pickUpID;
|
||||
List<String> photos;
|
||||
@@ -34,6 +35,7 @@ class Package {
|
||||
this.boxNumber,
|
||||
this.rate,
|
||||
this.weight,
|
||||
this.amount,
|
||||
this.packageType,
|
||||
this.pickUpID,
|
||||
this.remark,
|
||||
|
||||
Reference in New Issue
Block a user