Merge branch 'master' of tzw/fcs into master

This commit is contained in:
2020-10-09 11:38:24 +00:00
committed by Gogs
6 changed files with 693 additions and 451 deletions

View File

@@ -234,6 +234,26 @@
"box.length":"Length", "box.length":"Length",
"box.width":"Width", "box.width":"Width",
"box.height":"Height", "box.height":"Height",
"box.shipment_info":"Shipment Information",
"box.cargo_type":"Cargo Types",
"box.dimension":"Box Dimension",
"box.delivery_address":"Delivery Address",
"box.fcs_shipment_num":"FCS Shipment Number",
"box.fcs.id":"FCS ID",
"box.name":"Customer Name",
"box.phone":"Phone Number",
"box.actual_weight":"Actual Weight",
"box.add_cargo":"Add Cargo",
"box.shipment_weight":"Shipment Weight",
"box.change_address":"Change\nAddress",
"box.status":"Status",
"box.create.btn":"Create New Box",
"box.complete.btn":"Complete packing",
"box.deliver.btn":"Deliver",
"box.packages":"Packages",
"box.tracking.id":"Tracking ID",
"box.market":"Market",
"box.cargo.save.btn":"Save",
"Boxes End ================================================================":"", "Boxes End ================================================================":"",
"Delivery Start ================================================================":"", "Delivery Start ================================================================":"",
@@ -293,7 +313,7 @@
"Rate End ================================================================":"", "Rate End ================================================================":"",
"Cargo Start ================================================================":"", "Cargo Start ================================================================":"",
"cargo.form.title":"CARGO", "cargo.form.title":"Cargo",
"cargo.type":"Cargo Type", "cargo.type":"Cargo Type",
"cargo.weight":"Weight", "cargo.weight":"Weight",
"cargo.rate":"Rate", "cargo.rate":"Rate",

View File

@@ -222,18 +222,38 @@
"Message End ================================================================":"", "Message End ================================================================":"",
"Boxes Start ================================================================":"", "Boxes Start ================================================================":"",
"boxes.name":"Boxes", "boxes.name":"သေတ္တာများ",
"boxes.title":"Boxes", "boxes.title":"Boxes",
"boxes.new":"New Box", "boxes.new":"သေတ္တာအသစ်",
"box.edit.title":"Edit Box", "box.edit.title":"သေတ္တာ ပြင်ဆင်ခြင်း",
"box.package.id":"Package ID", "box.package.id":"Package ID",
"box.package.desc":"Description", "box.package.desc":"Description",
"box.package.market":"Market", "box.package.market":"Market",
"box.add_package":"Add Package", "box.add_package":"Add Package",
"box.number":"Box Number", "box.number":"Box Number",
"box.length":"Length", "box.length":"အရှည်",
"box.width":"Width", "box.width":"အကျယ်",
"box.height":"Height", "box.height":"အမြင့်",
"box.shipment_info":"တင်ပို့သတင်းအချက်အလက်",
"box.cargo_type":"ကုန်ပစ္စည်းအမျိုးအစားများ",
"box.dimension":"သေတ္တာအရွယ်အစား",
"box.delivery_address":"ပို့ဆောင်ရမည့်လိပ်စာ",
"box.fcs_shipment_num":"FCS တင်ပို့နံပါတ်",
"box.fcs.id":"FCS ID",
"box.name":"နာမည်",
"box.phone":"ဖုန်းနံပါတ်",
"box.actual_weight":"အမှန်အလေးချိန်",
"box.add_cargo":"ကုန်ပစ္စည်း\nထည့်ရန်",
"box.shipment_weight":"တင်ပို့အလေးချိန်",
"box.change_address":"လိပ်စာ\nပြောင်းရန်",
"box.status":"အခြေအနေ",
"box.create.btn":"သေတ္တာအသစ်ပြုလုပ်မည်",
"box.complete.btn":"ထုပ်ပိုးခြင်းပြီးဆုံးမည်",
"box.deliver.btn":"ပေးပို့မည်",
"box.packages":"အထုပ်များ",
"box.tracking.id":"Tracking ID",
"box.market":"အွန်လိုင်စျေးဆိုင်",
"box.cargo.save.btn":"သိမ်းဆည်းမည်",
"Boxes End ================================================================":"", "Boxes End ================================================================":"",
"Delivery Start ================================================================":"", "Delivery Start ================================================================":"",
@@ -293,7 +313,7 @@
"Rate End ================================================================":"", "Rate End ================================================================":"",
"Cargo Start ================================================================":"", "Cargo Start ================================================================":"",
"cargo.form.title":"ကုန်ပစ္စည်းအမျိုးအစား", "cargo.form.title":"ကုန်ပစ္စည်း",
"cargo.type":"ကုန်ပစ္စည်းအမျိုးအစား", "cargo.type":"ကုန်ပစ္စည်းအမျိုးအစား",
"cargo.weight":"အလေးချိန်", "cargo.weight":"အလေးချိန်",
"cargo.rate":"စျေးနှုန်း", "cargo.rate":"စျေးနှုန်း",

View File

@@ -25,6 +25,7 @@ class Package {
String boxNumber; String boxNumber;
String cargoDesc; String cargoDesc;
String market; String market;
bool isChecked;
int rate; int rate;
int weight; int weight;
@@ -40,36 +41,36 @@ class Package {
shipmentNumber + "-" + receiverNumber + " #" + boxNumber; shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
double get price => rate.toDouble() * weight; double get price => rate.toDouble() * weight;
Package({ Package(
this.id, {this.id,
this.trackingID, this.trackingID,
this.userID, this.userID,
this.userName, this.userName,
this.fcsID, this.fcsID,
this.phoneNumber, this.phoneNumber,
this.shipmentNumber, this.shipmentNumber,
this.senderFCSID, this.senderFCSID,
this.senderName, this.senderName,
this.receiverFCSID, this.receiverFCSID,
this.receiverName, this.receiverName,
this.receiverNumber, this.receiverNumber,
this.receiverAddress, this.receiverAddress,
this.boxNumber, this.boxNumber,
this.rate, this.rate,
this.weight, this.weight,
this.packageType, this.packageType,
this.pickUpID, this.pickUpID,
this.remark, this.remark,
this.status, this.status,
this.arrivedDate, this.arrivedDate,
this.cargoDesc, this.cargoDesc,
this.market, this.market,
this.shipmentHistory, this.shipmentHistory,
this.currentStatus, this.currentStatus,
this.currentStatusDate, this.currentStatusDate,
this.photoUrls, this.photoUrls,
this.desc, this.desc,
}); this.isChecked =false});
factory Package.fromMap(Map<String, dynamic> map, String docID) { factory Package.fromMap(Map<String, dynamic> map, String docID) {
var _currentStatusDate = (map['current_status_date'] as Timestamp); var _currentStatusDate = (map['current_status_date'] as Timestamp);

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,7 @@ import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart'; import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/box/model/box_model.dart'; import 'package:fcs/pages/box/model/box_model.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.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:fcs/pages/widgets/progress.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@@ -41,7 +42,8 @@ class _BoxListState extends State<BoxList> {
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
), ),
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("boxes.title")), title: LocalText(context, "boxes.name",
color: Colors.white, fontSize: 20),
actions: <Widget>[ actions: <Widget>[
IconButton( IconButton(
icon: Icon( icon: Icon(

View File

@@ -0,0 +1,90 @@
import 'package:fcs/domain/entities/cargo.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/progress.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class CargoTypeEditor extends StatefulWidget {
final Cargo cargo;
CargoTypeEditor({this.cargo});
@override
_CargoTypeEditorState createState() => _CargoTypeEditorState();
}
class _CargoTypeEditorState extends State<CargoTypeEditor> {
TextEditingController _typeController = new TextEditingController();
TextEditingController _weightController = new TextEditingController();
bool _isLoading = false;
Cargo _cargo;
@override
void initState() {
super.initState();
if (widget.cargo != null) {
_cargo = widget.cargo;
_typeController.text = _cargo.type;
_weightController.text = _cargo.weight.toString();
}
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
final typeBox = InputText(
labelTextKey: 'cargo.type',
iconData: Icons.text_format,
controller: _typeController);
final rateBox = InputText(
labelTextKey: 'cargo.weight',
iconData: FontAwesomeIcons.weightHanging,
textInputType: TextInputType.number,
controller: _weightController);
final saveBtn = fcsButton(
context,
getLocalString(context, 'box.cargo.save.btn'),
callack: () {},
);
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: primaryColor, size: 30),
onPressed: () => Navigator.of(context).pop(),
),
shadowColor: Colors.transparent,
backgroundColor: Colors.white,
title: LocalText(
context,
"cargo.form.title",
fontSize: 20,
color: primaryColor,
)),
body: Container(
padding: EdgeInsets.all(18),
child: ListView(
children: <Widget>[
typeBox,
rateBox,
SizedBox(height: 40),
saveBtn,
SizedBox(height: 20),
],
),
),
),
);
}
}