resolve conflit

This commit is contained in:
Thinzar Win
2020-10-14 21:46:35 +06:30
75 changed files with 2002 additions and 450 deletions

View File

@@ -384,11 +384,15 @@
"invoice.box.cargo_type": "Cargo types",
"invoice.cargo_type":"Cargo types",
"invoice.box.number":"Carton number",
"invoice.box.length":"Length",
"invoice.box.width":"Width",
"invoice.boc.height":"Height",
"invoice.box.length":"L",
"invoice.box.width":"W",
"invoice.boc.height":"H",
"invoice.discount_value": "Discount",
"invoice.net_amount":"Net Amount",
"invoice.customer_info":"Customer information",
"invoice.pdf": "Invoice PDF",
"invoice.total_custom_fee":"Total custom fee",
"invoice.shipment_weight":"Shipment weight",
"Invoices End ================================================================":"",
"Discount Start ================================================================":"",

View File

@@ -384,11 +384,15 @@
"invoice.description": "ငွေတောင်းခံလွှာအကြောင်းအရာ",
"invoice.cargo_type":"Cargo Types",
"invoice.box.number":"Box နံပါတ်",
"invoice.box.length":"အလျား",
"invoice.box.width":"အနံ",
"invoice.box.height":"အမြင့်",
"invoice.box.length":"L",
"invoice.box.width":"W",
"invoice.box.height":"H",
"invoice.discount_value": "လျှော့စျေး",
"invoice.net_amount":"Net Amount",
"invoice.customer_info":"Customer information",
"invoice.pdf": "Invoice PDF",
"invoice.total_custom_fee":"အခွန်စုစုပေါင်း",
"invoice.shipment_weight":"Shipment weight",
"Invoices End ================================================================":"",
"Discount Start ================================================================":"",

View File

@@ -402,10 +402,10 @@ class _BoxEditorState extends State<BoxEditor> {
return InkWell(
onTap: () async {
Cargo cargo = await Navigator.push<Cargo>(
context,
BottomUpPageRoute(CargoTypeEditor(
cargo: c.value,
)));
context,
CupertinoPageRoute(
builder: (context) => CargoTypeEditor(cargo: c.value)),
);
_addCargo(cargo);
},
child: Container(
@@ -631,7 +631,11 @@ class _BoxEditorState extends State<BoxEditor> {
),
onPressed: () async {
Cargo cargo = await Navigator.push<Cargo>(
context, BottomUpPageRoute(CargoTypeEditor()));
context,
CupertinoPageRoute(
builder: (context) => CargoTypeEditor()),
);
_addCargo(cargo);
}),
),
@@ -652,9 +656,10 @@ class _BoxEditorState extends State<BoxEditor> {
onTap: () async {
DeliveryAddress d = await Navigator.push<DeliveryAddress>(
context,
BottomUpPageRoute(DeliveryAddressSelection(
deliveryAddress: _deliveryAddress,
)),
CupertinoPageRoute(
builder: (context) => DeliveryAddressSelection(
deliveryAddress: _deliveryAddress,
)),
);
if (d == null) return;
setState(() {

View File

@@ -545,7 +545,7 @@ class _BoxInfoState extends State<BoxInfo> {
_gotoEditor() async {
Navigator.push(
context,
BottomUpPageRoute(BoxEditor(box: widget.box)),
CupertinoPageRoute(builder: (context) => BoxEditor(box: widget.box)),
);
}
}

View File

@@ -86,7 +86,7 @@ class _BoxListState extends State<BoxList> {
_newPickup() {
Navigator.push(
context,
BottomUpPageRoute(BoxEditor()),
CupertinoPageRoute(builder: (context) => BoxEditor()),
);
}

View File

@@ -1,10 +1,8 @@
import 'package:fcs/domain/entities/box.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'box_editor.dart';
import 'box_info.dart';
class BoxListRow extends StatefulWidget {
@@ -35,7 +33,7 @@ class _BoxListRowState extends State<BoxListRow> {
onTap: () {
Navigator.push(
context,
BottomUpPageRoute(BoxInfo(box: _box)),
CupertinoPageRoute(builder: (context) => BoxInfo(box: _box)),
);
},
child: Row(

View File

@@ -6,6 +6,7 @@ import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_dropdown.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
@@ -81,7 +82,8 @@ class _CargoTypeEditorState extends State<CargoTypeEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon:
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,

View File

@@ -4,6 +4,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -67,7 +68,7 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage>
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),

View File

@@ -176,7 +176,8 @@ class MessageDetail extends StatelessWidget {
Provider.of<PackageModel>(context, listen: false);
Package p = await packageModel.getPackage(message.messageID);
if (p == null) return;
Navigator.push<bool>(context, BottomUpPageRoute(PackageInfo(package: p)));
Navigator.push<bool>(context,
CupertinoPageRoute(builder: (context) => PackageInfo(package: p)));
}
if (message.messageType == message_type_profile &&
message.messageID != null &&
@@ -184,13 +185,14 @@ class MessageDetail extends StatelessWidget {
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
if (mainModel.user.isCustomer()) {
Navigator.push<bool>(context, BottomUpPageRoute(Profile()));
Navigator.push<bool>(
context, CupertinoPageRoute(builder: (context) => Profile()));
} else {
CustomerModel customerModel =
Provider.of<CustomerModel>(context, listen: false);
User user = await customerModel.getUser(message.messageID);
Navigator.of(context)
.push(BottomUpPageRoute(CustomerEditor(customer: user)));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => CustomerEditor(customer: user)));
}
}
}

View File

@@ -30,7 +30,7 @@ class _ContactPageState extends State<ContactPage> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),

View File

@@ -5,6 +5,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -51,7 +52,7 @@ class _CustomerEditorState extends State<CustomerEditor> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
size: 30,
),

View File

@@ -59,7 +59,7 @@ class _CustomerListState extends State<CustomerList> {
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
Navigator.of(context).push(BottomUpPageRoute(InvitationCreate()));
Navigator.of(context).push(CupertinoPageRoute(builder: (context) => InvitationCreate()));
},
icon: Icon(Icons.add),
label: LocalText(context, "invitation.new", color: Colors.white),
@@ -204,7 +204,7 @@ class _CustomerListState extends State<CustomerList> {
_select(User customer) {
Navigator.of(context)
.push(BottomUpPageRoute(CustomerEditor(customer: customer)));
.push(CupertinoPageRoute(builder: (context) => CustomerEditor(customer: customer)));
}
_gotoMsg(User customer) {
@@ -212,7 +212,7 @@ class _CustomerListState extends State<CustomerList> {
Provider.of<MessageModel>(context, listen: false);
messageModel.initQuery(customer.id);
Navigator.of(context)
.push(BottomUpPageRoute(MessageDetail(
.push(CupertinoPageRoute(builder: (context) => MessageDetail(
receiverID: customer.id,
receiverName: customer.name,
messageModel: messageModel,

View File

@@ -5,6 +5,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -47,7 +48,7 @@ class _InvitationCreateState extends State<InvitationCreate> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),

View File

@@ -4,6 +4,7 @@ import 'package:fcs/pages/customer/model/customer_model.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -49,7 +50,7 @@ class _InvitationEditorState extends State<InvitationEditor> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
size: 30,
),

View File

@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/box.dart';
import 'package:fcs/pages/box/box_editor.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@@ -34,12 +35,12 @@ class _DeliveryListRowState extends State<DeliveryListRow> {
if (widget.isReadOnly) {
// Navigator.push(
// context,
// BottomUpPageRoute(PackageInfo(package: _box)),
// CupertinoPageRoute(builder: (context) => PackageInfo(package: _box)),
// );
} else {
Navigator.push(
context,
BottomUpPageRoute(BoxEditor(box: _box)),
CupertinoPageRoute(builder: (context) => BoxEditor(box: _box)),
);
}
},

View File

@@ -5,6 +5,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -104,7 +105,7 @@ class _DeliveryAddressEditorState extends State<DeliveryAddressEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -5,6 +5,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -40,7 +41,7 @@ class _DeliveryAddressListState extends State<DeliveryAddressList> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.pop(context),
),
backgroundColor: primaryColor,
@@ -53,8 +54,8 @@ class _DeliveryAddressListState extends State<DeliveryAddressList> {
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
Navigator.of(context)
.push(BottomUpPageRoute(DeliveryAddressEditor()));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => DeliveryAddressEditor()));
},
icon: Icon(Icons.add),
label: LocalText(context, "delivery_address.new_address",
@@ -100,8 +101,9 @@ class _DeliveryAddressListState extends State<DeliveryAddressList> {
_edit(BuildContext context, DeliveryAddress deliveryAddress) {
Navigator.push(
context,
BottomUpPageRoute(
DeliveryAddressEditor(deliveryAddress: deliveryAddress)),
CupertinoPageRoute(
builder: (context) =>
DeliveryAddressEditor(deliveryAddress: deliveryAddress)),
);
}

View File

@@ -5,6 +5,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -72,7 +73,7 @@ class _DiscountEditorState extends State<DiscountEditor> {
AppTranslations.of(context).text("discount.form"),
),
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -11,6 +11,9 @@ import 'package:provider/provider.dart';
import 'discount_editor.dart';
class DiscountList extends StatefulWidget {
final bool selected;
const DiscountList({Key key, this.selected}) : super(key: key);
@override
_DiscountListState createState() => _DiscountListState();
}
@@ -50,12 +53,15 @@ class _DiscountListState extends State<DiscountList> {
var discount = discountModel.discounts[index];
return InkWell(
onTap: () {
Navigator.push(
context,
BottomUpPageRoute(DiscountEditor(
discount: discount,
)),
);
widget.selected
? Navigator.pop(context, discount)
: Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => DiscountEditor(
discount: discount,
)),
);
},
child: Padding(
padding: const EdgeInsets.all(10.0),
@@ -119,7 +125,7 @@ class _DiscountListState extends State<DiscountList> {
onPressed: () {
Navigator.push(
context,
BottomUpPageRoute(DiscountEditor()),
CupertinoPageRoute(builder: (context) => DiscountEditor()),
);
},
icon: Icon(Icons.add),

View File

@@ -46,7 +46,8 @@ class _FAQListPageState extends State<FAQListPage>
floatingActionButton: isEditable
? FloatingActionButton.extended(
onPressed: () {
Navigator.of(context).push(BottomUpPageRoute(FAQEditor()));
Navigator.of(context).push(
CupertinoPageRoute(builder: (context) => FAQEditor()));
},
icon: Icon(Icons.add),
label: LocalText(context, "faq.add.title", color: Colors.white),
@@ -171,9 +172,11 @@ class _FAQListPageState extends State<FAQListPage>
_selectLinkPage(String linkPage) {
if (linkPage == page_payment_methods) {
Navigator.of(context).push(BottomUpPageRoute(PaymentMethodPage()));
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => PaymentMethodPage()));
} else if (linkPage == page_buying_instructions) {
Navigator.of(context).push(BottomUpPageRoute(BuyingOnlinePage()));
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => BuyingOnlinePage()));
}
}
}

View File

@@ -11,6 +11,7 @@ import 'package:fcs/pages/widgets/local_button.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/popupmenu.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -89,7 +90,7 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
centerTitle: true,
shadowColor: Colors.transparent,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor),
icon: new Icon(CupertinoIcons.back, color: primaryColor),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: Colors.white,

View File

@@ -77,6 +77,7 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
}
_newShipment() {
Navigator.of(context).push(BottomUpPageRoute(FcsShipmentEditor()));
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => FcsShipmentEditor()));
}
}

View File

@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/fcs_shipment.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
@@ -19,8 +20,8 @@ class FcsShipmentListRow extends StatelessWidget {
padding: EdgeInsets.only(left: 15, right: 15),
child: InkWell(
onTap: () {
Navigator.of(context)
.push(BottomUpPageRoute(FcsShipmentEditor(shipment: shipment)));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => FcsShipmentEditor(shipment: shipment)));
},
child: Row(
children: <Widget>[

View File

@@ -3,6 +3,7 @@ import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/box/model/box_model.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -40,7 +41,7 @@ class _BoxAdditionState extends State<BoxAddition> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -2,8 +2,10 @@ import 'package:fcs/domain/entities/package.dart';
import 'package:fcs/domain/entities/user.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/invoice/invoice_shipment_list.dart';
import 'package:fcs/pages/invoice/model/invoice_model.dart';
import 'package:fcs/pages/package_search/package_serach.dart';
import 'package:fcs/pages/shipment/shipment_list.dart';
import 'package:fcs/pages/user_search/user_serach.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
@@ -92,48 +94,7 @@ class _InvoiceListState extends State<InvoiceList> {
}
_newInvoice() {
Navigator.of(context).push(BottomUpPageRoute(InvoiceEditor()));
}
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]);
}),
),
],
);
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => InvoiceShipmentList()));
}
}

View File

@@ -0,0 +1,148 @@
import 'package:fcs/domain/entities/user.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/customer/customer_editor.dart';
import 'package:fcs/pages/customer/model/customer_model.dart';
import 'package:fcs/pages/invoice/invoice_editor.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
class InvoiceCustomerList extends StatefulWidget {
@override
_InvoiceCustomerListState createState() => _InvoiceCustomerListState();
}
class _InvoiceCustomerListState extends State<InvoiceCustomerList> {
var dateFormatter = new DateFormat('dd MMM yyyy - hh:mm:ss a');
final double dotSize = 15.0;
bool _isLoading = false;
@override
Widget build(BuildContext context) {
var customerModel = Provider.of<CustomerModel>(context);
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: LocalText(
context,
"customer.list.title",
fontSize: 20,
color: Colors.white,
),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.grey,
),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: customerModel.customers.length,
itemBuilder: (BuildContext context, int index) {
User customer = customerModel.customers[index];
return _item(customer);
}),
),
],
),
),
);
}
Widget _item(User customer) {
return InkWell(
onTap: () {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => InvoiceEditor(customer: customer)));
},
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12),
child: Row(
children: <Widget>[
Expanded(
child: new Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: new Row(
children: <Widget>[
InkWell(
onTap: () => _select(customer),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Container(
padding: const EdgeInsets.only(
left: 10.0, right: 10, top: 6, bottom: 6),
decoration: BoxDecoration(
color: primaryColor,
borderRadius:
BorderRadius.all(Radius.circular(35.0))),
child: Text(
customer.initial,
style: TextStyle(fontSize: 30, color: Colors.white),
),
),
),
),
new Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 2.0),
child: new Text(
customer.name,
style: new TextStyle(
fontSize: 20.0, color: primaryColor),
),
),
Padding(
padding: const EdgeInsets.only(top: 2.0),
child: new Text(
customer.getLastMessage,
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),
),
],
),
),
),
],
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(right: 5),
child: Text(customer.getLastMessageTime),
),
],
),
],
),
),
);
}
_select(User customer) {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => CustomerEditor(customer: customer)));
}
}

View File

@@ -1,20 +1,24 @@
import 'package:fcs/domain/entities/box.dart';
import 'package:fcs/domain/entities/cargo.dart';
import 'package:fcs/domain/entities/custom.dart';
import 'package:fcs/domain/entities/discount.dart';
import 'package:fcs/domain/entities/invoice.dart';
import 'package:fcs/domain/entities/payment_method.dart';
import 'package:fcs/domain/entities/user.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/discount/discount_list.dart';
import 'package:fcs/pages/discount/model/discount_model.dart';
import 'package:fcs/pages/main/model/language_model.dart';
import 'package:fcs/pages/main/model/main_model.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/payment_methods/model/payment_method_model.dart';
import 'package:fcs/pages/rates/custom_list.dart';
import 'package:fcs/pages/user_search/user_serach.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/discount_dropdown.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_dropdown.dart';
import 'package:fcs/pages/widgets/local_text.dart';
@@ -23,6 +27,7 @@ import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/my_data_table.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -33,7 +38,8 @@ import 'box_addition.dart';
class InvoiceEditor extends StatefulWidget {
final Invoice invoice;
InvoiceEditor({this.invoice});
final User customer;
InvoiceEditor({this.invoice, this.customer});
@override
_InvoiceEditorState createState() => _InvoiceEditorState();
@@ -62,14 +68,17 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
bool isSwitched = false;
int deliveryfee = 0;
int customFee = 10;
int handlingFee = 0;
double total = 0;
Discount _discount;
bool isNew = false;
Discount selectedDiscount;
int selectedDiscountAmt;
PaymentMethod paymentMethod;
double volumetricRatio = 0;
List<Box> selectedBoxes = [];
List<Custom> customs = [];
List<Cargo> _cargoTypes = [
Cargo(type: 'General Cargo', weight: 33, price: 6),
@@ -84,6 +93,10 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
@override
void initState() {
super.initState();
volumetricRatio =
Provider.of<MainModel>(context, listen: false).setting.volumetricRatio;
if (widget.invoice != null) {
_invoice = widget.invoice;
_invoiceNumberController.text = _invoice.invoiceNumber;
@@ -107,6 +120,10 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
_customFeeController.text = '0';
_descriptionController.text = '';
_balanceController.text = '0';
}
if (widget.customer != null) {
user = widget.customer;
setState(() {
isNew = true;
});
@@ -171,17 +188,33 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
var discountModel = Provider.of<DiscountModel>(context);
var paymentMethodModel = Provider.of<PaymentMethodModel>(context);
final discountBox = Container(
child: DiscountDropdown<Discount>(
callback: (v) {
setState(() {
selectedDiscount = v;
});
},
iconData: Entypo.price_ribbon,
selectedValue: selectedDiscount,
values: discountModel.discounts,
));
final nameBox = DisplayText(
iconData: Feather.user,
labelTextKey: 'invoice.customer_name',
text: user != null ? user.name : '');
final statusBox = DisplayText(
text: _statusController.text,
iconData: Icons.av_timer,
labelTextKey: 'invoice.status');
final fcsIDBox = Row(
children: <Widget>[
Expanded(
child: DisplayText(
text: user != null ? user.fcsID : "",
labelTextKey: "box.fcs.id",
icon: FcsIDIcon(),
)),
IconButton(
icon: Icon(Icons.search, color: primaryColor),
onPressed: () => searchUser(context, callbackUserSelect: (u) {
setState(() {
this.user = u;
});
})),
],
);
return LocalProgress(
inAsyncCall: _isLoading,
@@ -189,7 +222,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor),
icon: new Icon(CupertinoIcons.back, color: primaryColor),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: Colors.white,
@@ -201,7 +234,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
padding: const EdgeInsets.all(8.0),
child: ListView(
children: <Widget>[
LocalTitle(textKey: "package.create.name"),
LocalTitle(textKey: "invoice.customer_info"),
DisplayText(
labelTextKey: 'invoice.date',
iconData: Icons.date_range,
@@ -212,73 +245,27 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
labelTextKey: 'invoice.number',
iconData: FontAwesomeIcons.fileInvoice,
text: _invoiceNumberController.text),
widget.invoice == null
? Row(
children: <Widget>[
Expanded(
child: DisplayText(
text: user != null ? user.name : "",
labelTextKey: "invoice.customer_name",
iconData: Feather.user,
)),
IconButton(
icon: Icon(Icons.search, color: primaryColor),
onPressed: () =>
searchUser(context, callbackUserSelect: (u) {
setState(() {
this.user = u;
});
})),
],
)
: DisplayText(
text: _nameController.text,
iconData: Feather.user,
labelTextKey: 'invoice.customer_name'),
InputText(
controller: _handlingFeeController,
iconData: FontAwesomeIcons.moneyBill,
labelTextKey: 'invoice.handling_fee'),
SizedBox(height: 15),
discountBox,
widget.invoice == null
? Container()
: DisplayText(
text: _statusController.text,
iconData: Icons.av_timer,
labelTextKey: 'invoice.status'),
SizedBox(height: 30),
fcsIDBox,
nameBox,
isNew ? statusBox : Container(),
SizedBox(height: 20),
LocalTitle(textKey: "invoice.box_info"),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: MyDataTable(
headingRowHeight: 40,
// columnSpacing: 20,
columns: [
MyDataColumn(
label: Text(''),
),
MyDataColumn(
label: LocalText(
context,
"invoice.box.number",
color: Colors.grey,
),
),
MyDataColumn(
label: Text(
getLocalString(context, "invoice.box.length") +
' x ' +
getLocalString(context, "invoice.box.width") +
' x ' +
getLocalString(context, "invoice.box.height"),
),
),
],
rows: getBoxRow(context),
),
),
SizedBox(height: 40),
Center(child: Column(children: getCartonRows(context))),
SizedBox(height: 20),
LocalTitle(
textKey: "invoice.custom_fee",
trailing: IconButton(
icon: Icon(Icons.add_circle, color: primaryColor),
onPressed: () async {
Custom custom = await Navigator.of(context).push(
CupertinoPageRoute(
builder: (context) => CustomList()));
setState(() {
if (custom != null) customs.add(custom);
});
})),
Column(children: getCustomFeeRows(context)),
SizedBox(height: 20),
LocalTitle(textKey: "invoice.cargo_type"),
Column(children: getCargoTableByBox(context)),
SizedBox(height: 20),
@@ -295,7 +282,10 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
Container(
width: 150.0,
child: DropdownButtonFormField(
icon: Icon(Icons.edit),
icon: Icon(
Icons.edit,
color: primaryColor,
),
value: paymentMethod,
items: paymentMethodModel.paymentMethods
.map((e) => DropdownMenuItem(
@@ -307,31 +297,12 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
],
),
),
SizedBox(height: 30),
!isNew
? Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Row(
children: [
Icon(Icons.receipt, color: primaryColor),
SizedBox(width: 10),
LocalText(
context,
"invoice.payment_attachment",
color: Colors.grey,
fontSize: 20,
fontWeight: FontWeight.w700,
),
],
),
),
Spacer(),
Icon(Icons.add, color: primaryColor),
],
)
: Container(),
SizedBox(height: 20),
LocalTitle(
textKey: "invoice.payment_attachment",
trailing: IconButton(
icon: Icon(Icons.add_circle, color: primaryColor),
onPressed: () async {})),
widget.invoice == null
? fcsButton(
context, getLocalString(context, 'invoice.btn_create'))
@@ -355,6 +326,168 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
);
}
getCartonRows(BuildContext context) {
List<Widget> dataRow = [];
dataRow = _boxes.map((box) {
return Container(
height: 50,
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding:
const EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
child: Row(
children: [
Container(
width: 33,
child: Checkbox(
value: true, onChanged: (v) {}, activeColor: primaryColor),
),
Expanded(flex: 1, child: Text(box.packageNumber)),
Expanded(
flex: 1,
child: Text(
box.length == null
? ""
: box.length.toString() +
' x ' +
box.length.toString() +
' x ' +
box.height.toString(),
textAlign: TextAlign.center)),
Expanded(
flex: 2,
child: Center(
child: Text(
box.getShipmentWeight(volumetricRatio).toString()))),
],
),
);
}).toList();
dataRow.insert(
0,
Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 5.0, bottom: 15.0),
child: Row(
children: [
Container(width: 33),
Expanded(
flex: 1,
child: Center(
child: LocalText(
context,
"invoice.box.number",
color: Colors.grey,
),
)),
Expanded(
flex: 1,
child: Center(
child: Text('L x W x H',
style: TextStyle(color: Colors.grey)))),
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
"invoice.shipment_weight",
color: Colors.grey,
),
)),
],
),
));
return dataRow;
}
getCustomFeeRows(BuildContext context) {
customFee = 0;
List<Widget> dataRow = [];
dataRow = customs.map((custom) {
customFee += custom.fee;
return Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding:
const EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
child: Row(
children: [
Expanded(flex: 2, child: Text('${custom.productType}')),
Expanded(
flex: 1,
child: Text('\$ ${custom.fee}', textAlign: TextAlign.center)),
Expanded(
child: IconButton(
icon: Icon(Icons.remove_circle, color: primaryColor),
onPressed: () {
customs.remove(custom);
}))
],
),
);
}).toList();
dataRow.insert(
0,
Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 15.0, bottom: 15.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Text('Product', style: TextStyle(color: Colors.grey))),
Expanded(
flex: 1,
child: Text('Fee',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
Expanded(flex: 1, child: Container())
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 15.0, bottom: 15.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.total_custom_fee',
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
flex: 1,
child: Center(
child: Text('\$ $customFee',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold)))),
Expanded(
child: Container(),
)
],
),
));
return dataRow;
}
getCargoTableByBox(BuildContext context) {
var discountModel = Provider.of<DiscountModel>(context);
total = 0;
@@ -430,8 +563,9 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
flex: 1,
child: Container(
alignment: Alignment.centerRight,
child: LocalText(
context,
'invoice.total',
@@ -439,6 +573,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
),
),
),
SizedBox(width: 40),
Expanded(
child: Text(
'\$ $total',
@@ -452,12 +587,13 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(left: 5.0, right: 5.0, top: 10),
padding: const EdgeInsets.only(left: 5.0, right: 5.0, top: 0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
flex: 1,
child: Container(
alignment: Alignment.centerRight,
child: LocalText(
context,
'invoice.discount_value',
@@ -465,9 +601,20 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
),
),
),
new IconButton(
icon: Icon(Icons.search, color: primaryColor),
onPressed: () async {
Discount discount = await Navigator.of(context).push(
CupertinoPageRoute(
builder: (context) =>
DiscountList(selected: true)));
setState(() {
if (discount != null) _discount = discount;
});
}),
Expanded(
child: Text(
'\$ ${_discount != null ? _discount.amount.toInt() : 0}',
'\$ ( ${_discount != null ? _discount.amount.toInt() : 0} )',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
@@ -481,18 +628,21 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 20.0, bottom: 0.0),
left: 5.0, right: 5.0, top: 10.0, bottom: 0.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.custom_fee',
color: Colors.black,
),
)),
flex: 1,
child: Container(
alignment: Alignment.centerRight,
child: LocalText(
context,
'invoice.custom_fee',
color: Colors.black,
),
),
),
SizedBox(width: 40),
Expanded(
child: Text('\$ ${customFee}',
textAlign: TextAlign.end,
@@ -505,6 +655,37 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(left: 5.0, right: 5.0, top: 20.0),
child: Row(
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerRight,
child: LocalText(
context,
'invoice.handling_fee',
color: Colors.black,
),
),
),
new IconButton(
icon: Icon(Icons.edit, color: primaryColor),
onPressed: () async {}),
Expanded(
child: Text('\$ $handlingFee',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
)))
],
),
));
dataRow.insert(
dataRow.length,
Container(
@@ -629,8 +810,9 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
getTotalBalance(total) {
double balance = 0;
double custom = customFee != 0 ? customFee.toDouble() : 0;
double discount = _discount != null ? _discount.amount.toDouble() : 0;
double deliveryFee = deliveryfee != 0 ? deliveryfee.toDouble() : 0;
balance = (total + custom + deliveryFee) - 100.0;
balance = (total + custom + deliveryFee) - discount;
return balance;
}

View File

@@ -0,0 +1,809 @@
import 'package:fcs/domain/entities/box.dart';
import 'package:fcs/domain/entities/cargo.dart';
import 'package:fcs/domain/entities/custom.dart';
import 'package:fcs/domain/entities/discount.dart';
import 'package:fcs/domain/entities/invoice.dart';
import 'package:fcs/domain/entities/payment_method.dart';
import 'package:fcs/domain/entities/user.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/discount/discount_list.dart';
import 'package:fcs/pages/discount/model/discount_model.dart';
import 'package:fcs/pages/invoice/invoice_editor.dart';
import 'package:fcs/pages/main/model/language_model.dart';
import 'package:fcs/pages/main/model/main_model.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/payment_methods/model/payment_method_model.dart';
import 'package:fcs/pages/rates/custom_list.dart';
import 'package:fcs/pages/user_search/user_serach.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/discount_dropdown.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_dropdown.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/local_title.dart';
import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/my_data_table.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.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 'package:provider/provider.dart';
import 'box_addition.dart';
class InvoiceInfoPage extends StatefulWidget {
final Invoice invoice;
InvoiceInfoPage({this.invoice});
@override
_InvoiceInfoPageState createState() => _InvoiceInfoPageState();
}
class _InvoiceInfoPageState extends State<InvoiceInfoPage> {
User user;
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();
TextEditingController _handlingFeeController = new TextEditingController();
TextEditingController _customFeeController = new TextEditingController();
MultiImgController multiImgController = MultiImgController();
TextEditingController _descriptionController = new TextEditingController();
TextEditingController _balanceController = new TextEditingController();
Invoice _invoice;
bool _isLoading = false;
List<Box> _boxes = [];
bool isSwitched = false;
int deliveryfee = 0;
int customFee = 0;
double total = 0;
Discount _discount;
bool isNew = false;
Discount selectedDiscount;
int selectedDiscountAmt;
PaymentMethod paymentMethod;
double volumetricRatio = 0;
List<Box> selectedBoxes = [];
List<Custom> customs = [];
List<Cargo> _cargoTypes = [
Cargo(type: 'General Cargo', weight: 33, price: 6),
Cargo(type: 'Medicine', weight: 33, price: 7),
Cargo(type: 'Dangerous Cargo', weight: 33, price: 8)
];
List<String> _receipts = [
"assets/buying_online_with_first_last_name.png",
];
@override
void initState() {
super.initState();
volumetricRatio =
Provider.of<MainModel>(context, listen: false).setting.volumetricRatio;
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.getAmount.toString();
_amountController.text = _invoice.amount.toString();
_statusController.text = _invoice.status.toString();
_handlingFeeController.text = '0';
_customFeeController.text = '0';
// multiImgController.setImageUrls = _receipts;
_descriptionController.text = 'For Electronics goods';
_balanceController.text =
(_invoice.amount - _invoice.receipts[0].amount).toString();
// _boxes = _invoice.packages;
} else {
_dateController.text = dateFormatter.format(DateTime.now());
_amountController.text = '0';
_handlingFeeController.text = '0';
_customFeeController.text = '0';
_descriptionController.text = '';
_balanceController.text = '0';
setState(() {
isNew = true;
});
}
_boxes = [
Box(
shipmentNumber: "A202",
receiverNumber: "3",
receiverName: "Ko Myo Min",
boxNumber: "1",
rate: 7,
packageType: "General",
weight: 75,
status: "Packed",
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
cargoDesc: "Clothes",
arrivedDate: DateTime(2020, 6, 1),
width: 10,
height: 10,
length: 10,
// packages: packages,
// statusHistory: statusHistory,
cargoTypes: [
Cargo(type: 'General Cargo', weight: 25),
Cargo(type: 'Medicine', weight: 20),
Cargo(type: 'Dangerous Cargo', weight: 30)
]),
Box(
shipmentNumber: "A202",
receiverNumber: "3",
receiverName: "Ko Myo Min",
boxNumber: "2",
rate: 7,
packageType: "General",
weight: 75,
status: "Packed",
cargoDesc: "Clothes",
arrivedDate: DateTime(2020, 6, 1),
width: 10,
height: 10,
length: 10,
// statusHistory: statusHistory,
// packages: packages,
receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon',
cargoTypes: [
Cargo(type: 'General Cargo', weight: 25),
Cargo(type: 'Medicine', weight: 20),
Cargo(type: 'Dangerous Cargo', weight: 30)
])
];
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
var mainModel = Provider.of<MainModel>(context);
var discountModel = Provider.of<DiscountModel>(context);
var paymentMethodModel = Provider.of<PaymentMethodModel>(context);
final nameBox = DisplayText(
iconData: Feather.user,
labelTextKey: 'invoice.customer_name',
text: user != null ? user.name : '');
final fcsIDBox = Row(
children: <Widget>[
Expanded(
child: DisplayText(
text: user != null ? user.fcsID : "",
labelTextKey: "box.fcs.id",
icon: FcsIDIcon(),
)),
IconButton(
icon: Icon(Icons.search, color: primaryColor),
onPressed: () => searchUser(context, callbackUserSelect: (u) {
setState(() {
this.user = u;
});
})),
],
);
final statusBox = DisplayText(
text: _statusController.text,
iconData: Icons.av_timer,
labelTextKey: 'invoice.status');
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(CupertinoIcons.back, color: primaryColor),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: Colors.white,
shadowColor: Colors.transparent,
title: LocalText(context, 'invoice.form.title',
color: primaryColor, fontSize: 20),
actions: [
new IconButton(
icon: Icon(
Icons.delete,
color: primaryColor,
),
onPressed: () {}),
new IconButton(
icon: Icon(
Icons.edit,
color: primaryColor,
),
onPressed: () {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => InvoiceEditor(invoice: _invoice)));
})
],
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
children: <Widget>[
LocalTitle(textKey: "invoice.customer_info"),
DisplayText(
labelTextKey: 'invoice.date',
iconData: Icons.date_range,
text: _dateController.text),
widget.invoice == null
? Container()
: DisplayText(
labelTextKey: 'invoice.number',
iconData: FontAwesomeIcons.fileInvoice,
text: _invoiceNumberController.text),
fcsIDBox,
nameBox,
statusBox,
LocalTitle(textKey: "invoice.box_info"),
Center(child: Column(children: getCartonRows(context))),
SizedBox(height: 20),
LocalTitle(textKey: "invoice.custom_fee"),
Column(children: getCustomFeeRows(context)),
SizedBox(height: 20),
LocalTitle(textKey: "invoice.cargo_type"),
Column(children: getCargoTableByBox(context)),
SizedBox(height: 20),
Container(
padding: EdgeInsets.only(top: 5, left: 18),
child: Row(
children: <Widget>[
Expanded(
child: LocalText(context, 'invoice.payment_method',
fontSize: 16,
color: Colors.grey,
fontWeight: FontWeight.bold),
),
Text(
'${paymentMethod != null ? paymentMethod.accountName : "KBZ Bank"}',
style: TextStyle(fontSize: 16)),
],
),
),
SizedBox(height: 30),
!isNew
? LocalTitle(textKey: "invoice.payment_attachment")
: Container(),
],
),
),
),
);
}
getCartonRows(BuildContext context) {
List<Widget> dataRow = [];
dataRow = _boxes.map((box) {
return Container(
height: 50,
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding:
const EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
child: Row(
children: [
Expanded(flex: 2, child: Text(box.packageNumber)),
Expanded(
flex: 1,
child: Text(
box.length == null
? ""
: box.length.toString() +
' x ' +
box.length.toString() +
' x ' +
box.height.toString(),
textAlign: TextAlign.center)),
Expanded(
flex: 2,
child: Center(
child: Text(
box.getShipmentWeight(volumetricRatio).toString()))),
],
),
);
}).toList();
dataRow.insert(
0,
Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 5.0, bottom: 15.0),
child: Row(
children: [
Expanded(
flex: 2,
child: LocalText(
context,
"invoice.box.number",
color: Colors.grey,
)),
Expanded(
flex: 1,
child:
Text('L x W x H', style: TextStyle(color: Colors.grey))),
Expanded(
flex: 2,
child: LocalText(
context,
"invoice.shipment_weight",
color: Colors.grey,
)),
],
),
));
return dataRow;
}
getCustomFeeRows(BuildContext context) {
customFee = 0;
List<Widget> dataRow = [];
dataRow = customs.map((custom) {
customFee += custom.fee;
return Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding:
const EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
child: Row(
children: [
Expanded(flex: 2, child: Text('${custom.productType}')),
Expanded(
flex: 1,
child: Text('\$ ${custom.fee}', textAlign: TextAlign.center)),
Expanded(child: SizedBox(height: 40))
],
),
);
}).toList();
dataRow.insert(
0,
Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 15.0, bottom: 15.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Text('Product', style: TextStyle(color: Colors.grey))),
Expanded(
flex: 1,
child: Text('Fee',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
Expanded(flex: 1, child: Container())
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 15.0, bottom: 15.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.total_custom_fee',
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
flex: 1,
child: Center(
child: Text('\$ $customFee',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold)))),
Expanded(
child: Container(),
)
],
),
));
return dataRow;
}
getCargoTableByBox(BuildContext context) {
total = 0;
List<Widget> dataRow = _cargoTypes.map((cargo) {
var amount = cargo.weight * cargo.price;
total += amount;
return Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 15.0, bottom: 15.0),
child: Row(
children: [
Expanded(flex: 2, child: Text('${cargo.type}')),
Expanded(
flex: 2,
child: Text('${cargo.weight} x ${cargo.price}',
textAlign: TextAlign.center)),
Expanded(
child: Text('\$ $amount',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
)))
],
),
);
}).toList();
dataRow.insert(
0,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 15.0, bottom: 15.0),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
child: Row(
children: [
Expanded(
flex: 2,
child: Text(getLocalString(context, 'invoice.box.cargo_type'),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.grey))),
Expanded(
flex: 2,
child: Text(
getLocalString(context, 'cargo.weight') +
' x ' +
getLocalString(context, 'cargo.rate'),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.grey))),
Expanded(
child: Text(getLocalString(context, 'invoice.amount'),
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.grey)))
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 10.0, bottom: 10.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.total',
color: Colors.black,
),
),
),
Expanded(
child: Text(
'\$ $total',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
textAlign: TextAlign.end,
))
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(left: 5.0, right: 5.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.discount_value',
color: Colors.black,
),
),
),
Expanded(
child: Text(
'\$ ${_discount != null ? _discount.amount.toInt() : 0}',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
)))
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 10.0, bottom: 0.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.custom_fee',
color: Colors.black,
),
)),
Expanded(
child: Text('\$ $customFee',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
)),
),
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 20.0, bottom: 0.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.handling_fee',
color: Colors.black,
),
)),
Expanded(
child: Text('\$ $customFee',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
)),
),
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 10.0, bottom: 10.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.delivery_fee',
color: Colors.black,
),
),
),
Expanded(
child: Text('\$ $deliveryfee',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
)))
],
),
));
dataRow.insert(
dataRow.length,
Container(
child: Row(
children: [
Expanded(child: Text('')),
Expanded(
flex: 2,
child: Divider(
thickness: 3,
)),
],
)));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 10.0, bottom: 10.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.net_amount',
color: Colors.black,
fontSize: 15,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
child: Text('\$ ${getTotalBalance(total)}',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: primaryColor)))
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 10.0, bottom: 10.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'invoice.balance',
color: Colors.black,
fontSize: 15,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
child: Text('\$ ${getTotalBalance(total)}',
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: primaryColor)))
],
),
));
return dataRow;
}
getTotalBalance(total) {
double balance = 0;
double custom = customFee != 0 ? customFee.toDouble() : 0;
double deliveryFee = deliveryfee != 0 ? deliveryfee.toDouble() : 0;
double discount = _discount != null ? _discount.amount.toDouble() : 0;
balance = (total + custom + deliveryFee) - discount;
return balance;
}
List<MyDataRow> getBoxRow(BuildContext context) {
return _boxes.map((p) {
p.cargoTypes.map((cargo) {
_cargoTypes.asMap().map((index, _cargo) {
if (_cargo.type == cargo.type) {
setState(() {
_cargoTypes[index].weight += cargo.weight;
});
}
});
});
return MyDataRow(
onSelectChanged: (bool selected) {},
cells: [
MyDataCell(Checkbox(
value: true,
onChanged: (value) {
selectedBoxes.add(p);
},
)),
MyDataCell(new Text(
p.boxNumber == null
? ""
: '${p.shipmentNumber}-${p.receiverNumber} #${p.boxNumber}',
style: textStyle,
)),
MyDataCell(new Text(
p.length == null
? ""
: p.length.toString() +
' x ' +
p.length.toString() +
' x ' +
p.height.toString(),
style: textStyle,
)),
],
);
}).toList();
}
List<MyDataRow> getCargoDataRow(BuildContext context) {
return _cargoTypes.asMap().entries.map((c) {
var cargo = c.value;
var amt = cargo.weight * cargo.price;
return MyDataRow(
onSelectChanged: (bool selected) {},
cells: [
MyDataCell(new Text(
cargo.type,
style: textStyle,
)),
MyDataCell(new Text(
cargo.weight.toString() + ' x ' + cargo.price.toString(),
style: textStyle,
)),
MyDataCell(new Text(
"\$$amt",
style: textStyle,
)),
],
);
}).toList()
// .insert(_cargoTypes.length,MyDataRow(cells: [
// MyDataCell(new Text('')),
// MyDataCell(new Text('Total')),
// MyDataCell(new Text(
// "\$5000",
// style: textStyle,
// )),
// ])
// )
;
}
}

View File

@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:fcs/domain/entities/invoice.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/invoice/invoice_info.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@@ -78,12 +79,14 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
child: InkWell(
onTap: () {
owner
? Navigator.of(context).push(
BottomUpPageRoute(InvoiceEditor(invoice: _invoice)))
: Navigator.of(context)
.push(BottomUpPageRoute(PaymentPDFScreen(
path: pdfPath,
)));
? Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => PaymentPDFScreen(
path: pdfPath,
)))
: Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => PaymentPDFScreen(
path: pdfPath,
)));
},
child: new Row(
children: <Widget>[
@@ -147,8 +150,9 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
],
),
onPressed: () {
Navigator.of(context).push(
BottomUpPageRoute(PaymentPage(invoice: _invoice)));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) =>
PaymentPage(invoice: _invoice)));
},
)),
)
@@ -178,18 +182,19 @@ class _InvoiceListRowState extends State<InvoiceListRow> {
CupertinoActionSheetAction(
child: Row(
children: <Widget>[
Icon(Icons.file_download),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
'Download',
'See detail',
style: TextStyle(fontSize: 16, color: Colors.black),
),
),
],
),
onPressed: () {
Navigator.pop(context);
//to go invoice info page
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => InvoiceInfoPage(invoice: _invoice)));
},
)
],

View File

@@ -0,0 +1,76 @@
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/shipment/model/shipment_model.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';
import 'invoice_shipment_list_row.dart';
class InvoiceShipmentList extends StatefulWidget {
@override
_InvoiceShipmentListState createState() => _InvoiceShipmentListState();
}
class _InvoiceShipmentListState extends State<InvoiceShipmentList> {
bool _isLoading = false;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
var pickupModel = Provider.of<ShipmentModel>(context);
return LocalProgress(
inAsyncCall: _isLoading,
child: DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: LocalText(context, "shipment",
fontSize: 18, color: Colors.white),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.search,
color: Colors.white,
),
iconSize: 30,
// onPressed: () => showPlacesSearch(context),
),
],
),
body: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.pickups.length,
itemBuilder: (BuildContext context, int index) {
return InvoiceShipmentListRow(
pickUp: pickupModel.pickups[index]);
}),
),
),
);
}
}

View File

@@ -0,0 +1,116 @@
import 'package:fcs/domain/entities/pickup.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import '../main/util.dart';
import 'invoice_customer_list.dart';
class InvoiceShipmentListRow extends StatefulWidget {
final Shipment pickUp;
const InvoiceShipmentListRow({this.pickUp});
@override
_InvoiceShipmentListRowState createState() => _InvoiceShipmentListRowState();
}
class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
final double dotSize = 15.0;
Shipment _pickUp = new Shipment();
@override
void initState() {
super.initState();
if (widget.pickUp != null) {
_pickUp = widget.pickUp;
}
}
@override
Widget build(BuildContext context) {
print('_pickup $_pickUp');
return Container(
padding: EdgeInsets.only(left: 15, right: 15),
child: InkWell(
onTap: () {
Navigator.of(context).push(
CupertinoPageRoute(builder: (context) => InvoiceCustomerList()));
},
child: Row(
children: <Widget>[
Expanded(
child: new Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: new Row(
children: <Widget>[
Padding(
padding: EdgeInsets.all(5.0),
child: Icon(
SimpleLineIcons.direction,
color: primaryColor,
)),
new Expanded(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Text(
_pickUp.id == null ? '' : _pickUp.id,
style: new TextStyle(
fontSize: 15.0, color: Colors.black),
),
),
Padding(
padding: const EdgeInsets.only(left: 10.0, top: 10),
child: new Text(
_pickUp.id == null
? ''
: "Last ${_pickUp.last} days",
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),
)
],
),
),
],
),
),
),
Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(0),
child: getStatus(_pickUp.status),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
child: Row(
children: <Widget>[
new Text(
_pickUp.weight == null
? ''
: _pickUp.weight.toString() + 'lb - ',
style:
new TextStyle(fontSize: 15.0, color: Colors.grey),
),
new Text(
_pickUp.numberOfPackage == null
? ""
: _pickUp.numberOfPackage.toString() + ' packages',
style:
new TextStyle(fontSize: 15.0, color: Colors.grey),
),
],
),
),
],
)
],
),
),
);
}
}

View File

@@ -2,12 +2,15 @@ import 'package:fcs/domain/entities/invoice.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/local_title.dart';
import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/my_data_table.dart';
import 'package:fcs/pages/widgets/number_cell.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -23,28 +26,18 @@ class PaymentPage extends StatefulWidget {
}
class _PaymentPageState extends State<PaymentPage> {
TextEditingController _addressEditingController = new TextEditingController();
TextEditingController _fromTimeEditingController =
new TextEditingController();
TextEditingController _toTimeEditingController = new TextEditingController();
TextEditingController _noOfPackageEditingController =
new TextEditingController();
TextEditingController _weightEditingController = new TextEditingController();
MultiImgController multiImgController = MultiImgController();
TextEditingController _amountController = new TextEditingController();
var dateFormatter = new DateFormat('dd MMM yyyy');
Invoice _invoice = new Invoice();
bool _isLoading = false;
List<String> _receipts = [
"assets/buying_online_with_first_last_name.png",
];
bool isNew;
@override
void initState() {
if (widget.invoice != null) {
_invoice = widget.invoice;
// multiImgController.setImageUrls = _receipts;
}
super.initState();
}
@@ -58,7 +51,16 @@ class _PaymentPageState extends State<PaymentPage> {
@override
Widget build(BuildContext context) {
final saveBox = fcsButton(context, getLocalString(context, 'btn.save'));
final amountBox = InputText(
labelTextKey: 'pm.amount',
controller: _amountController,
iconData: FontAwesomeIcons.moneyBill);
final receiptFileBox = Row(children: [
LocalText(context, 'pm.attachment', fontSize: 16, color: Colors.grey),
IconButton(
icon: Icon(Icons.attachment, color: primaryColor), onPressed: () {})
]);
return LocalProgress(
inAsyncCall: _isLoading,
@@ -66,122 +68,123 @@ class _PaymentPageState extends State<PaymentPage> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("pm_.title")),
actions: [
IconButton(icon: Icon(Icons.cloud_upload), onPressed: () {})
],
),
body: ListView(
padding: const EdgeInsets.all(15.0),
padding: const EdgeInsets.all(10.0),
children: <Widget>[
Container(
child: Row(
children: <Widget>[
LocalText(context, 'pm.total.amount',
color: Colors.black, fontSize: 16),
Text(
' \$ ${_invoice.amount}',
style: TextStyle(
color: primaryColor,
fontSize: 16,
fontWeight: FontWeight.bold),
)
],
)),
Container(
padding: const EdgeInsets.only(top: 15.0),
child: Row(
children: <Widget>[
LocalText(context, 'pm.remaining_balance',
color: Colors.black, fontSize: 16),
Text(
' \$ ${_invoice.amount - _invoice.receipts[0].amount}',
style: TextStyle(
color: primaryColor,
fontSize: 16,
fontWeight: FontWeight.bold),
)
],
)),
amountBox,
SizedBox(height: 10),
receiptFileBox,
SizedBox(height: 10),
Divider(),
SizedBox(height: 10),
LocalText(context, 'pm.attachment',
color: primaryColor, fontSize: 16, fontWeight: FontWeight.bold),
Padding(
padding: EdgeInsets.only(left: 20, top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 8),
child: Text(
'${dateFormatter.format(_invoice.receipts[0].date)} ',
style: TextStyle(color: Colors.black, fontSize: 16),
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10),
child: MultiImageFile(
enabled: true,
controller: multiImgController,
title: "Receipt File",
)),
),
],
),
LocalTitle(textKey: "pm.receipt"),
Column(
children: getCustomFeeRows(context),
),
SizedBox(height: 25),
Divider(),
SizedBox(height: 10),
LocalText(context, 'pm.receipt',
color: primaryColor, fontSize: 16, fontWeight: FontWeight.bold),
Container(
child: MyDataTable(
headingRowHeight: 40,
columnSpacing: 20,
columns: [
MyDataColumn(
label: LocalText(
context,
"pm.date",
color: Colors.grey,
),
),
MyDataColumn(
label: LocalText(
context,
"pm.amount",
color: Colors.grey,
),
),
],
rows: getPackageRow(context),
),
),
SizedBox(height: 25),
// saveBox,
// SizedBox(height: 10),
],
),
),
);
}
List<MyDataRow> getPackageRow(BuildContext context) {
return _invoice.receipts.map((r) {
return MyDataRow(
onSelectChanged: (bool selected) {},
cells: [
MyDataCell(
new Text(dateFormatter.format(r.date), style: textStyle),
),
MyDataCell(NumberCell(r.amount))
],
getCustomFeeRows(BuildContext context) {
List<Widget> dataRow = [];
dataRow = _invoice.receipts.asMap().entries.map((receipt) {
var r = receipt.value;
var k = receipt.key + 1;
return Container(
height: 50,
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding:
const EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0, bottom: 5.0),
child: Row(
children: [
Expanded(flex: 2, child: Text(dateFormatter.format(r.date))),
Expanded(
flex: 2,
child: Center(child: Text('receipt' + k.toString() + '.png'))),
Expanded(flex: 1, child: Center(child: Text('pending'))),
Expanded(flex: 1, child: Center(child: Text('\$ ${r.amount}'))),
],
),
);
}).toList();
dataRow.insert(
0,
Container(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey))),
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 10.0, bottom: 15.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Text('Product', style: TextStyle(color: Colors.grey))),
Expanded(
flex: 2,
child: Text('File',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
Expanded(
flex: 1,
child: Text('Status',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
Expanded(
flex: 1,
child: Text('Fee',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
],
),
));
dataRow.insert(
dataRow.length,
Container(
padding: const EdgeInsets.only(
left: 5.0, right: 5.0, top: 15.0, bottom: 15.0),
child: Row(
children: [
Expanded(
flex: 2,
child: Center(
child: LocalText(
context,
'pm.remaining_balance',
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
flex: 2,
child: Container(),
),
Expanded(
flex: 1,
child: Center(
child: Text('\$ 300',
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 16.0)))),
],
),
));
return dataRow;
}
}

View File

@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_pdfview/flutter_pdfview.dart';
@@ -29,8 +30,18 @@ class _PaymentPDFScreenState extends State<PaymentPDFScreen>
return Scaffold(
appBar: AppBar(
backgroundColor: primaryColor,
title: Text("Invoice File"),
title: LocalText(context, 'invoice.pdf',
color: Colors.white, fontSize: 20),
leading: new IconButton(
icon: new Icon(CupertinoIcons.back),
onPressed: () {
Navigator.of(context).pop();
}),
actions: <Widget>[
IconButton(
icon: Icon(Icons.file_download),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.share),
onPressed: () {},

View File

@@ -256,8 +256,9 @@ class _HomePageState extends State<HomePage> {
final shipmentCostBtn = TaskButton("rate",
icon: FontAwesomeIcons.calculator,
btnCallback: () =>
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
btnCallback: () => Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => ShipmentRates(),
)));
final fcsShipmentBtn = TaskButton("FCSshipment.title",
icon: Ionicons.ios_airplane,
@@ -373,7 +374,7 @@ class _HomePageState extends State<HomePage> {
);
final signinBtn = FlatButton(
onPressed: () {
Navigator.of(context).push(BottomUpPageRoute(SigninPage()));
Navigator.of(context).push(CupertinoPageRoute(builder: (context) => SigninPage()));
},
child: Text(
"Sign In",
@@ -530,10 +531,11 @@ class _HomePageState extends State<HomePage> {
}
Navigator.push(
context,
BottomUpPageRoute(PackageInfo(
package: package,
isSearchResult: true,
)),
CupertinoPageRoute(
builder: (context) => PackageInfo(
package: package,
isSearchResult: true,
)),
);
} catch (e) {
showMsgDialog(context, "Error", e.toString());

View File

@@ -86,8 +86,8 @@ class _WelcomePageState extends State<WelcomePage> {
),
FlatButton(
onPressed: () {
Navigator.of(context)
.push(BottomUpPageRoute(SigninPage()));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => SigninPage()));
},
child: Text(
getLocalString(context, "welcome.signin"),

View File

@@ -5,6 +5,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -60,7 +61,7 @@ class _MarketEditorState extends State<MarketEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,

View File

@@ -13,6 +13,7 @@ import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
@@ -90,7 +91,7 @@ class _PackageEditorPageState extends State<PackageEditorPage> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,
@@ -210,7 +211,7 @@ class _PackageEditorPageState extends State<PackageEditorPage> {
_manageMarket() {
Navigator.push<Package>(
context,
BottomUpPageRoute(MarketEditor()),
CupertinoPageRoute(builder: (context) => MarketEditor()),
);
}

View File

@@ -15,6 +15,7 @@ import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:fcs/pages/widgets/status_tree.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
@@ -115,9 +116,10 @@ class _PackageInfoState extends State<PackageInfo> {
? () async {
DeliveryAddress d = await Navigator.push<DeliveryAddress>(
context,
BottomUpPageRoute(DeliveryAddressSelection(
deliveryAddress: _deliveryAddress,
)),
CupertinoPageRoute(
builder: (context) => DeliveryAddressSelection(
deliveryAddress: _deliveryAddress,
)),
);
if (d == null) return;
_changeDeliverayAddress(d);
@@ -131,7 +133,7 @@ class _PackageInfoState extends State<PackageInfo> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,

View File

@@ -137,7 +137,7 @@ class _PackageListState extends State<PackageList> {
if (_package == null) return;
Navigator.push(
context,
BottomUpPageRoute(PackageInfo(package: _package)),
CupertinoPageRoute(builder: (context) => PackageInfo(package: _package)),
);
}
}

View File

@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/package.dart';
import 'package:fcs/pages/package/package_info.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@@ -28,7 +29,7 @@ class PackageListRow extends StatelessWidget {
}
Navigator.push(
context,
BottomUpPageRoute(PackageInfo(package: package)),
CupertinoPageRoute(builder: (context) => PackageInfo(package: package)),
);
},
child: Row(

View File

@@ -10,6 +10,7 @@ import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -81,7 +82,7 @@ class _PackageNewState extends State<PackageNew> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,
@@ -171,7 +172,7 @@ class _PackageNewState extends State<PackageNew> {
_addPackage() async {
Package package = await Navigator.push<Package>(
context,
BottomUpPageRoute(TrackingIDPage()),
CupertinoPageRoute(builder: (context) => TrackingIDPage()),
);
if (package != null) {

View File

@@ -10,6 +10,7 @@ import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:permission_handler/permission_handler.dart';
@@ -146,7 +147,7 @@ class _TrackingIDPageState extends State<TrackingIDPage> {
_manageMarket() {
Navigator.push<Package>(
context,
BottomUpPageRoute(MarketEditor()),
CupertinoPageRoute(builder: (context) => MarketEditor()),
);
}

View File

@@ -6,6 +6,7 @@ import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:provider/provider.dart';
@@ -58,7 +59,7 @@ class _PaymentMethodEditorState extends State<PaymentMethodEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor),
icon: new Icon(CupertinoIcons.back, color: primaryColor),
onPressed: () => Navigator.of(context).pop(),
),
title: LocalText(

View File

@@ -9,6 +9,7 @@ import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_icons/flutter_icons.dart';
@@ -35,7 +36,7 @@ class _PaymentMethodPageState extends State<PaymentMethodPage> {
appBar: AppBar(
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),
@@ -69,7 +70,8 @@ class _PaymentMethodPageState extends State<PaymentMethodPage> {
onPressed: () {
Navigator.push(
context,
BottomUpPageRoute(PaymentMethodEditor()),
CupertinoPageRoute(
builder: (context) => PaymentMethodEditor()),
);
},
icon: Icon(Icons.add),
@@ -95,9 +97,10 @@ class _PaymentMethodPageState extends State<PaymentMethodPage> {
? () {
Navigator.push(
context,
BottomUpPageRoute(PaymentMethodEditor(
paymentMethod: method,
)),
CupertinoPageRoute(
builder: (context) => PaymentMethodEditor(
paymentMethod: method,
)),
);
}
: null,

View File

@@ -16,6 +16,7 @@ import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
@@ -116,7 +117,7 @@ class _ProcessingEditorState extends State<ProcessingEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,
@@ -223,7 +224,7 @@ class _ProcessingEditorState extends State<ProcessingEditor> {
_manageMarket() {
Navigator.push<Package>(
context,
BottomUpPageRoute(MarketEditor()),
CupertinoPageRoute(builder: (context) => MarketEditor()),
);
}

View File

@@ -10,6 +10,7 @@ import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:fcs/pages/widgets/status_tree.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
@@ -100,7 +101,7 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,
@@ -177,9 +178,10 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
_gotoEditor() async {
bool deleted = await Navigator.push<bool>(
context,
BottomUpPageRoute(ProcessingEditor(
package: widget.package,
)));
CupertinoPageRoute(
builder: (context) => ProcessingEditor(
package: widget.package,
)));
if (deleted ?? false) {
Navigator.pop(context);
} else {

View File

@@ -90,7 +90,8 @@ class _ProcessingListState extends State<ProcessingList> {
if (_package == null) return;
Navigator.push(
context,
BottomUpPageRoute(ProcessingInfo(package: _package)),
CupertinoPageRoute(
builder: (context) => ProcessingInfo(package: _package)),
);
}
}

View File

@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/package.dart';
import 'package:fcs/pages/package/package_info.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@@ -30,7 +31,8 @@ class ProcessingListRow extends StatelessWidget {
}
Navigator.push(
context,
BottomUpPageRoute(ProcessingInfo(package: package)),
CupertinoPageRoute(
builder: (context) => ProcessingInfo(package: package)),
);
},
child: Row(

View File

@@ -182,7 +182,9 @@ class _ProfileState extends State<Profile> {
deliveryAddress: deliveryAddressModel.defalutAddress,
onTap: () {
Navigator.push(
context, BottomUpPageRoute(DeliveryAddressList()));
context,
CupertinoPageRoute(
builder: (context) => DeliveryAddressList()));
},
),
getPrivilegeBox(context),

View File

@@ -4,6 +4,7 @@ import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class CargoEditor extends StatefulWidget {
@@ -52,9 +53,7 @@ class _CargoEditorState extends State<CargoEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -4,6 +4,7 @@ import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -54,7 +55,7 @@ class _CustomEditorState extends State<CustomEditor> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
),
onPressed: () => Navigator.of(context).pop(),
),

View File

@@ -0,0 +1,86 @@
import 'package:fcs/domain/entities/custom.dart';
import 'package:fcs/domain/vo/delivery_address.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/delivery_address/delivery_address_editor.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/rates/custom_editor.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'custom_row.dart';
import 'model/shipment_rate_model.dart';
class CustomList extends StatefulWidget {
const CustomList({Key key}) : super(key: key);
@override
_CustomListState createState() => _CustomListState();
}
class _CustomListState extends State<CustomList> {
bool _isLoading = false;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.pop(context),
),
backgroundColor: primaryColor,
title: LocalText(
context,
"Customs",
fontSize: 20,
color: Colors.white,
),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView.separated(
separatorBuilder: (c, i) => Divider(
color: primaryColor,
),
itemCount: shipmentRateModel.customs.length,
itemBuilder: (context, index) {
return _row(context, shipmentRateModel.customs[index]);
}),
)),
);
}
_row(BuildContext context, Custom custom) {
return InkWell(
onTap: () => Navigator.pop<Custom>(context, custom),
child: Row(
children: [
Expanded(
child: CustomRow(
key: ValueKey(custom.id),
custom: custom,
),
),
],
),
);
}
}

View File

@@ -0,0 +1,66 @@
import 'package:fcs/domain/entities/custom.dart';
import 'package:fcs/domain/vo/delivery_address.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
typedef SelectionCallback(Custom custom);
class CustomRow extends StatelessWidget {
final Custom custom;
final SelectionCallback selectionCallback;
const CustomRow(
{Key key, this.custom, this.selectionCallback})
: super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: selectionCallback == null
? null
: () => this.selectionCallback(custom),
child: Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
line(context, custom.productType,
iconData: MaterialCommunityIcons.account,
color: primaryColor,
fontSize: 16),
line(context, custom.fee.toString(),
iconData: Icons.phone, color: primaryColor, fontSize: 16),
],
),
),
],
),
);
}
Widget line(BuildContext context, String text,
{IconData iconData, Color color, double fontSize}) {
return Row(
children: [
iconData == null
? SizedBox(width: 40)
: Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8),
child: Icon(iconData, color: Colors.black38),
),
Flexible(
child: TextLocalStyle(
context,
text ?? "",
fontSize: fontSize ?? 14,
color: color,
),
),
],
);
}
}

View File

@@ -4,6 +4,7 @@ import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -39,8 +40,7 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
@override
Widget build(BuildContext context) {
final weightBox = InputText(
final weightBox = InputText(
labelTextKey: 'rate.discount.weight',
iconData: FontAwesomeIcons.weightHanging,
controller: _weightController);
@@ -55,9 +55,7 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -7,6 +7,7 @@ import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -44,9 +45,7 @@ class _ShipmentRatesState extends State<ShipmentRates> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
@@ -129,12 +128,12 @@ class _ShipmentRatesState extends State<ShipmentRates> {
// .push(MaterialPageRoute(builder: (_) => Term()));
// }),
fcsButton(context, "Estimate shipping cost", callack: () {
Navigator.of(context)
.push(BottomUpPageRoute(ShipmentRatesCal()));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => ShipmentRatesCal()));
}),
fcsButton(context, "Edit", callack: () {
Navigator.of(context)
.push(BottomUpPageRoute(ShipmentRatesEdit()));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => ShipmentRatesEdit()));
}),
SizedBox(height: 10)
],

View File

@@ -2,6 +2,7 @@ import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';
@@ -37,9 +38,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -9,6 +9,7 @@ import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/my_data_table.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
@@ -69,7 +70,7 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
),
onPressed: () => Navigator.of(context).pop(),
),
@@ -136,7 +137,8 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
onPressed: () {
Navigator.push(
context,
BottomUpPageRoute(CargoEditor()),
CupertinoPageRoute(
builder: (context) => CargoEditor()),
);
},
label: Text(
@@ -199,7 +201,8 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
onPressed: () {
Navigator.push(
context,
BottomUpPageRoute(CustomEditor()),
CupertinoPageRoute(
builder: (context) => CustomEditor()),
);
},
label: Text(
@@ -263,7 +266,9 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
onPressed: () {
Navigator.push(
context,
BottomUpPageRoute(DiscountByWeightEditor()),
CupertinoPageRoute(
builder: (context) =>
DiscountByWeightEditor()),
);
},
label: Text(
@@ -297,7 +302,7 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
onSelectChanged: (selected) {
Navigator.push(
context,
BottomUpPageRoute(CargoEditor(rate: r)),
CupertinoPageRoute(builder: (context) => CargoEditor(rate: r)),
);
},
cells: [
@@ -325,7 +330,7 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
onSelectChanged: (selected) {
Navigator.push(
context,
BottomUpPageRoute(CustomEditor(custom: c)),
CupertinoPageRoute(builder: (context) => CustomEditor(custom: c)),
);
},
cells: [
@@ -353,7 +358,7 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
onSelectChanged: (selected) {
// Navigator.push(
// context,
// BottomUpPageRoute(CargoEditor(rate: r)),
// CupertinoPageRoute(builder: (context) => CargoEditor(rate: r)),
// );
},
cells: [

View File

@@ -13,6 +13,7 @@ import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:permission_handler/permission_handler.dart';
@@ -136,7 +137,7 @@ class _ReceivingEditorState extends State<ReceivingEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,

View File

@@ -12,6 +12,7 @@ import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/multi_img_file.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:fcs/pages/widgets/status_tree.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:intl/intl.dart';
@@ -90,7 +91,7 @@ class _ReceivingInfoState extends State<ReceivingInfo> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,
@@ -144,9 +145,10 @@ class _ReceivingInfoState extends State<ReceivingInfo> {
_edit() async {
await Navigator.push(
context,
BottomUpPageRoute(ReceivingEditor(
package: widget.package,
)),
CupertinoPageRoute(
builder: (context) => ReceivingEditor(
package: widget.package,
)),
);
PackageModel packageModel =
Provider.of<PackageModel>(context, listen: false);

View File

@@ -98,7 +98,7 @@ class _ReceivingListState extends State<ReceivingList> {
_newReceiving() {
Navigator.push(
context,
BottomUpPageRoute(ReceivingEditor()),
CupertinoPageRoute(builder: (context) => ReceivingEditor()),
);
}
@@ -108,7 +108,8 @@ class _ReceivingListState extends State<ReceivingList> {
if (_package == null) return;
Navigator.push(
context,
BottomUpPageRoute(ReceivingInfo(package: _package)),
CupertinoPageRoute(
builder: (context) => ReceivingInfo(package: _package)),
);
}
}

View File

@@ -1,6 +1,7 @@
import 'package:fcs/domain/entities/package.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@@ -29,7 +30,8 @@ class ReceivingListRow extends StatelessWidget {
}
Navigator.push(
context,
BottomUpPageRoute(ReceivingInfo(package: package)),
CupertinoPageRoute(
builder: (context) => ReceivingInfo(package: package)),
);
},
child: Row(

View File

@@ -15,6 +15,7 @@ import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/local_title.dart';
import 'package:fcs/pages/widgets/my_data_table.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:provider/provider.dart';
@@ -118,7 +119,7 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),
@@ -145,7 +146,9 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
),
onPressed: () async {
Cargo cargo = await Navigator.push<Cargo>(
context, BottomUpPageRoute(CargoTypeEditor()));
context,
CupertinoPageRoute(
builder: (context) => CargoTypeEditor()));
_addCargo(cargo);
}),
),
@@ -182,9 +185,10 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
onTap: () async {
DeliveryAddress d = await Navigator.push<DeliveryAddress>(
context,
BottomUpPageRoute(DeliveryAddressSelection(
deliveryAddress: _deliveryAddress,
)),
CupertinoPageRoute(
builder: (context) => DeliveryAddressSelection(
deliveryAddress: _deliveryAddress,
)),
);
if (d == null) return;
setState(() {
@@ -210,9 +214,10 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
onSelectChanged: (bool selected) async {
Cargo cargo = await Navigator.push<Cargo>(
context,
BottomUpPageRoute(CargoTypeEditor(
cargo: c,
)));
CupertinoPageRoute(
builder: (context) => CargoTypeEditor(
cargo: c,
)));
_addCargo(cargo);
},
cells: [

View File

@@ -22,6 +22,7 @@ import 'package:fcs/pages/widgets/local_title.dart';
import 'package:fcs/pages/widgets/multi_img_controller.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:fcs/pages/widgets/title_with_add_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -154,9 +155,10 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
onTap: () async {
DeliveryAddress d = await Navigator.push<DeliveryAddress>(
context,
BottomUpPageRoute(DeliveryAddressSelection(
deliveryAddress: _pickupAddress,
)),
CupertinoPageRoute(
builder: (context) => DeliveryAddressSelection(
deliveryAddress: _pickupAddress,
)),
);
if (d == null) return;
setState(() {
@@ -187,7 +189,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),
@@ -234,7 +236,8 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
onPressed: () {
Navigator.push(
context,
BottomUpPageRoute(ShipmentBoxEditor()),
CupertinoPageRoute(
builder: (context) => ShipmentBoxEditor()),
);
},
),
@@ -256,8 +259,8 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
return boxes.asMap().entries.map((_box) {
return InkWell(
onTap: () {
Navigator.of(context)
.push(BottomUpPageRoute(ShipmentBoxEditor(box: _box.value)));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => ShipmentBoxEditor(box: _box.value)));
},
child: BoxRow(box: _box.value),
);

View File

@@ -83,6 +83,7 @@ class _ShipmentListState extends State<ShipmentList> {
}
_newPickup() {
Navigator.of(context).push(BottomUpPageRoute(ShipmentEditor()));
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => ShipmentEditor()));
}
}

View File

@@ -1,6 +1,7 @@
import 'package:fcs/domain/entities/pickup.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
@@ -41,7 +42,7 @@ class _ShipmentListRowState extends State<ShipmentListRow> {
child: InkWell(
onTap: () {
Navigator.of(context)
.push(BottomUpPageRoute(ShipmentEditor(shipment: _pickUp)));
.push(CupertinoPageRoute(builder: (context) => ShipmentEditor(shipment: _pickUp)));
},
child: Row(
children: <Widget>[

View File

@@ -2,6 +2,7 @@ import 'package:fcs/pages/main/model/main_model.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
@@ -31,7 +32,7 @@ class _RequestInvitationPageState extends State<RequestInvitationPage> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -4,6 +4,7 @@ import 'package:fcs/pages/main/model/main_model.dart';
import 'package:fcs/pages/signin/invitation_request_page.dart';
import 'package:fcs/pages/signin/signup_page.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
@@ -21,11 +22,12 @@ navigateAfterAuthVerified(BuildContext context) async {
await Provider.of<MainModel>(context, listen: false).hasInvite();
if (!invited) {
await Navigator.of(context).pushAndRemoveUntil(
BottomUpPageRoute(RequestInvitationPage()), (r) => false);
CupertinoPageRoute(builder: (context) => RequestInvitationPage()),
(r) => false);
return;
}
}
await Navigator.of(context)
.pushAndRemoveUntil(BottomUpPageRoute(SignupPage()), (r) => false);
await Navigator.of(context).pushAndRemoveUntil(
CupertinoPageRoute(builder: (context) => SignupPage()), (r) => false);
}
}

View File

@@ -6,6 +6,7 @@ import 'package:fcs/pages/signin/signin_logic.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -44,7 +45,7 @@ class _SigninPageState extends State<SigninPage> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
@@ -174,8 +175,8 @@ class _SigninPageState extends State<SigninPage> {
AuthResult auth = await context.read<MainModel>().sendSms(phoneNumber);
if (auth.authStatus == AuthStatus.SMS_SENT) {
await Navigator.of(context)
.push(BottomUpPageRoute(SmsCodePage(phoneNumber: phoneNumber)));
await Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => SmsCodePage(phoneNumber: phoneNumber)));
Navigator.pop(context);
} else if (auth.authStatus == AuthStatus.AUTH_VERIFIED) {
await navigateAfterAuthVerified(context);

View File

@@ -2,6 +2,7 @@ import 'package:fcs/pages/main/model/main_model.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -32,7 +33,9 @@ class _SignupPageState extends State<SignupPage> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(
CupertinoIcons.back,
),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -7,6 +7,7 @@ import 'package:fcs/pages/signin/signin_logic.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:provider/provider.dart';
@@ -68,7 +69,7 @@ class _SmsCodePageState extends State<SmsCodePage> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,

View File

@@ -8,6 +8,7 @@ import 'package:fcs/pages/staff/model/staff_model.dart';
import 'package:fcs/pages/widgets/display_text.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -170,7 +171,8 @@ class _StaffEditorState extends State<StaffEditor> {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
icon:
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,

View File

@@ -45,7 +45,8 @@ class _StaffListState extends State<StaffList> {
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
Navigator.of(context).push(BottomUpPageRoute(StaffEditor()));
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => StaffEditor()));
},
icon: Icon(Icons.add),
label: LocalText(context, "staff.new", color: Colors.white),
@@ -72,8 +73,8 @@ class _StaffListState extends State<StaffList> {
children: <Widget>[
InkWell(
onTap: () {
Navigator.of(context)
.push(BottomUpPageRoute(StaffEditor(staff: user)));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => StaffEditor(staff: user)));
},
child: Row(
children: <Widget>[

View File

@@ -59,7 +59,7 @@ class _TermPageState extends State<TermPage> {
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
CupertinoIcons.back,
color: primaryColor,
),
onPressed: () => Navigator.of(context).pop(),

View File

@@ -15,14 +15,16 @@ class BottomWidgets extends StatelessWidget {
children: <Widget>[
InkWell(
onTap: () {
Navigator.of(context).push(BottomUpPageRoute(ContactPage()));
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => ContactPage()));
},
child: _buildSmallButton(
context, "contact.btn", SimpleLineIcons.support),
),
InkWell(
onTap: () {
Navigator.of(context).push(BottomUpPageRoute(TermPage()));
Navigator.of(context)
.push(CupertinoPageRoute(builder: (context) => TermPage()));
},
child: _buildSmallButton(context, "term.btn", Icons.info_outline),
),

View File

@@ -5,6 +5,7 @@ import 'package:fcs/pages/delivery_address/delivery_address_row.dart';
import 'package:fcs/pages/delivery_address/model/delivery_address_model.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@@ -22,7 +23,7 @@ class DeliveryAddressSelection extends StatelessWidget {
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
icon: new Icon(CupertinoIcons.back),
onPressed: () => Navigator.pop(context),
),
backgroundColor: primaryColor,
@@ -35,8 +36,8 @@ class DeliveryAddressSelection extends StatelessWidget {
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
Navigator.of(context)
.push(BottomUpPageRoute(DeliveryAddressEditor()));
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => DeliveryAddressEditor()));
},
icon: Icon(Icons.add),
label: LocalText(context, "delivery_address.new_address",