rename shipment
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
{
|
||||
"Buttons Start ================================================================":"",
|
||||
"btn.save":"သိမ်းဆည်းရန်",
|
||||
"btn.approve":"အတည်ပြုရန်",
|
||||
"btn.delete":"ဖျက်ရန်",
|
||||
"btn.select":"ရွေးချယ်ပါ",
|
||||
"btn.cancel":"Cancel",
|
||||
"Buttons End ================================================================":"",
|
||||
|
||||
"Contact Start ================================================================":"",
|
||||
"contact.btn":"ဆက်သွယ်ရန်",
|
||||
"contact.title":"ဆက်သွယ်ရန်",
|
||||
"contact.phone.title":"ဖုန်းနံပါတ်ထည့်သွင်းရန်",
|
||||
@@ -26,8 +35,8 @@
|
||||
"contact.findus":"တည်နေရာ",
|
||||
"contact.emailus":"အီးမေးလ်",
|
||||
"contact.visitus":"ကြည့်ပါ",
|
||||
|
||||
"contact.edit.title":"ဆက်သွယ်ရန် ပြုပြင်ခြင်း",
|
||||
"Contact End ================================================================":"",
|
||||
|
||||
"term":"စည်းကမ်းချက်များ",
|
||||
"term.btn":"စည်းကမ်းချက်များ",
|
||||
@@ -158,11 +167,6 @@
|
||||
"boxes.new":"New Box",
|
||||
"box.edit.title":"Edit Box",
|
||||
|
||||
"btn.save":"သိမ်းဆည်းရန်",
|
||||
"btn.approve":"အတည်ပြုရန်",
|
||||
"btn.delete":"ဖျက်ရန်",
|
||||
"btn.select":"ရွေးချယ်ပါ",
|
||||
"btn.cancel":"Cancel",
|
||||
|
||||
"================================================================":"",
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/payment_methods/model/payment_method_model.dart';
|
||||
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/shipment/model/pickup_model.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/shipment_address/model/shipment_address_model.dart';
|
||||
import 'package:fcs/pages/main/splash_page.dart';
|
||||
import 'package:fcs/pages/staff/model/staff_model.dart';
|
||||
@@ -40,7 +40,7 @@ class _AppState extends State<App> {
|
||||
final PaymentMethodModel paymentMethodModel = new PaymentMethodModel();
|
||||
final FcsShipmentModel fcsShipmentModel = new FcsShipmentModel();
|
||||
final LanguageModel lanuguageModel = new LanguageModel();
|
||||
final PickUpModel pickUpModel = new PickUpModel();
|
||||
final ShipmentModel shipmentModel = new ShipmentModel();
|
||||
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
||||
final BoxModel boxModel = new BoxModel();
|
||||
final MessageModel messageModel = new MessageModel();
|
||||
@@ -67,7 +67,7 @@ class _AppState extends State<App> {
|
||||
..addModel(discountModel)
|
||||
..addModel(shipmentRateModel)
|
||||
..addModel(boxModel)
|
||||
..addModel(pickUpModel)
|
||||
..addModel(shipmentModel)
|
||||
..addModel(invoiceModel)
|
||||
..addModel(marketModel);
|
||||
|
||||
@@ -98,7 +98,7 @@ class _AppState extends State<App> {
|
||||
ChangeNotifierProvider.value(value: mainModel),
|
||||
ChangeNotifierProvider.value(value: staffModel),
|
||||
ChangeNotifierProvider.value(value: lanuguageModel),
|
||||
ChangeNotifierProvider.value(value: pickUpModel),
|
||||
ChangeNotifierProvider.value(value: shipmentModel),
|
||||
ChangeNotifierProvider.value(value: shipmentRateModel),
|
||||
ChangeNotifierProvider.value(value: shipmentAddressModel),
|
||||
ChangeNotifierProvider.value(value: packageModel),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Shipment {
|
||||
class FcsShipment {
|
||||
DateTime shipDate;
|
||||
String shipmentNumber;
|
||||
DateTime cutoffDate;
|
||||
@@ -10,7 +10,7 @@ class Shipment {
|
||||
String destination;
|
||||
String status;
|
||||
String remark;
|
||||
Shipment(
|
||||
FcsShipment(
|
||||
{this.shipDate,
|
||||
this.shipmentNumber,
|
||||
this.cutoffDate,
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'cargo.dart';
|
||||
|
||||
class PickUp {
|
||||
class Shipment {
|
||||
String id;
|
||||
String userName;
|
||||
String phoneNumber;
|
||||
@@ -16,7 +16,7 @@ class PickUp {
|
||||
bool isCourier;
|
||||
int radioIndex;
|
||||
|
||||
PickUp(
|
||||
Shipment(
|
||||
{this.id,
|
||||
this.userName,
|
||||
this.phoneNumber,
|
||||
@@ -34,8 +34,8 @@ class PickUp {
|
||||
|
||||
int get last => DateTime.now().difference(date).inDays;
|
||||
|
||||
factory PickUp.fromMap(Map<String, dynamic> map, String id) {
|
||||
return PickUp(
|
||||
factory Shipment.fromMap(Map<String, dynamic> map, String id) {
|
||||
return Shipment(
|
||||
id: id,
|
||||
userName: map['user_name'],
|
||||
phoneNumber: map['phone_number'],
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:country_code_picker/country_code_picker.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/customer/model/customer_model.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';
|
||||
@@ -32,6 +33,11 @@ class _InvitationCreateState extends State<InvitationCreate> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final nameBox = InputText(
|
||||
labelTextKey: 'customer.name',
|
||||
iconData: Icons.person,
|
||||
controller: _nameController);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -57,8 +63,7 @@ class _InvitationCreateState extends State<InvitationCreate> {
|
||||
padding: EdgeInsets.all(18),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput(getLocalString(context, "customer.name"), Icons.person,
|
||||
controller: _nameController, autoFocus: false),
|
||||
nameBox,
|
||||
SizedBox(height: 10),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/fcs_shipment/model/fcs_shipment_model.dart';
|
||||
@@ -15,7 +15,7 @@ import 'package:flutter/material.dart';
|
||||
import '../main/util.dart';
|
||||
|
||||
class FcsShipmentEditor extends StatefulWidget {
|
||||
final Shipment shipment;
|
||||
final FcsShipment shipment;
|
||||
FcsShipmentEditor({this.shipment});
|
||||
|
||||
@override
|
||||
@@ -34,7 +34,7 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
TextEditingController _statusController = new TextEditingController();
|
||||
TextEditingController _remarkController = new TextEditingController();
|
||||
|
||||
Shipment _shipment = new Shipment();
|
||||
FcsShipment _shipment = new FcsShipment();
|
||||
bool _isLoading = false;
|
||||
String _currentShipment;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
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';
|
||||
@@ -9,7 +9,7 @@ import 'package:intl/intl.dart';
|
||||
import 'fcs_shipment_editor.dart';
|
||||
|
||||
class FcsShipmentListRow extends StatefulWidget {
|
||||
final Shipment shipment;
|
||||
final FcsShipment shipment;
|
||||
const FcsShipmentListRow({this.shipment});
|
||||
|
||||
@override
|
||||
@@ -19,7 +19,7 @@ class FcsShipmentListRow extends StatefulWidget {
|
||||
class _FcsShipmentListRowState extends State<FcsShipmentListRow> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final double dotSize = 15.0;
|
||||
Shipment _shipment = new Shipment();
|
||||
FcsShipment _shipment = new FcsShipment();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -1,40 +1,41 @@
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/data/services/services.dart';
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/pages/main/model/base_model.dart';
|
||||
|
||||
class FcsShipmentModel extends BaseModel {
|
||||
List<String> shipmentType = ['Air', 'Ship', 'Cargo Truck'];
|
||||
List<Shipment> shipments = [
|
||||
Shipment(
|
||||
List<FcsShipment> shipments = [
|
||||
FcsShipment(
|
||||
shipDate: DateTime(2020, 4, 23),
|
||||
shipmentNumber: 'A103B',
|
||||
status: 'In Progress',
|
||||
arrivalDate: DateTime(2020, 4, 30),
|
||||
departureDate: DateTime(2020, 4, 23)),
|
||||
Shipment(
|
||||
FcsShipment(
|
||||
shipDate: DateTime(2020, 4, 2),
|
||||
shipmentNumber: 'A100A',
|
||||
status: 'Ready to ship',
|
||||
arrivalDate: DateTime(2020, 4, 28),
|
||||
departureDate: DateTime(2020, 4, 15)),
|
||||
Shipment(
|
||||
FcsShipment(
|
||||
shipDate: DateTime(2020, 4, 2),
|
||||
shipmentNumber: 'A100B',
|
||||
status: 'Arrived',
|
||||
arrivalDate: DateTime(2020, 4, 28),
|
||||
departureDate: DateTime(2020, 4, 15)),
|
||||
Shipment(
|
||||
FcsShipment(
|
||||
shipDate: DateTime(2020, 4, 10),
|
||||
shipmentNumber: 'A102B',
|
||||
status: 'Canceled',
|
||||
arrivalDate: DateTime(2020, 4, 20),
|
||||
departureDate: DateTime(2020, 4, 10)),
|
||||
Shipment(
|
||||
FcsShipment(
|
||||
shipDate: DateTime(2020, 4, 2),
|
||||
shipmentNumber: 'A100B',
|
||||
status: 'Canceled',
|
||||
arrivalDate: DateTime(2020, 4, 20),
|
||||
departureDate: DateTime(2020, 4, 23)),
|
||||
Shipment(
|
||||
FcsShipment(
|
||||
shipDate: DateTime(2020, 4, 10),
|
||||
shipmentNumber: 'A102B',
|
||||
status: 'Arrived',
|
||||
@@ -43,23 +44,24 @@ class FcsShipmentModel extends BaseModel {
|
||||
)
|
||||
];
|
||||
|
||||
List<Shipment> get canceled {
|
||||
List<Shipment> _p = shipments.where((e) => e.status == "Canceled").toList()
|
||||
..sort((e1, e2) {
|
||||
return e1.shipDate.compareTo(e2.shipDate);
|
||||
});
|
||||
List<FcsShipment> get canceled {
|
||||
List<FcsShipment> _p =
|
||||
shipments.where((e) => e.status == "Canceled").toList()
|
||||
..sort((e1, e2) {
|
||||
return e1.shipDate.compareTo(e2.shipDate);
|
||||
});
|
||||
return _p;
|
||||
}
|
||||
|
||||
List<Shipment> get completed {
|
||||
List<FcsShipment> get completed {
|
||||
return shipments.where((e) => e.status == "Arrived").toList()
|
||||
..sort((e1, e2) {
|
||||
return e1.shipDate.compareTo(e2.shipDate);
|
||||
});
|
||||
}
|
||||
|
||||
List<Shipment> get upcoming {
|
||||
List<Shipment> _shipments = shipments
|
||||
List<FcsShipment> get upcoming {
|
||||
List<FcsShipment> _shipments = shipments
|
||||
.where((e) =>
|
||||
e.status == "In Progress" ||
|
||||
e.status == "Ready to ship" ||
|
||||
|
||||
@@ -19,7 +19,7 @@ import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/package/package_list.dart';
|
||||
import 'package:fcs/pages/rates/shipment_rates.dart';
|
||||
import 'package:fcs/pages/shipment/pickup_list.dart';
|
||||
import 'package:fcs/pages/shipment/shipment_list.dart';
|
||||
import 'package:fcs/pages/staff/staff_list.dart';
|
||||
import 'package:fcs/pages/widgets/task_button.dart';
|
||||
import 'package:fcs/pages/widgets/badge.dart';
|
||||
@@ -211,7 +211,7 @@ class _HomePageState extends State<HomePage> {
|
||||
final pickUpBtn = TaskButton("pickup",
|
||||
icon: SimpleLineIcons.direction,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(PickUpList())));
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentList())));
|
||||
|
||||
final shipmentCostBtn = TaskButton("rate",
|
||||
icon: FontAwesomeIcons.calculator,
|
||||
|
||||
@@ -87,69 +87,6 @@ Future<void> showConfirmDialog(
|
||||
});
|
||||
}
|
||||
|
||||
void showCommentDialog(BuildContext context, commentCallback(comment)) {
|
||||
TextEditingController _comment = new TextEditingController();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(32.0))),
|
||||
content: Container(
|
||||
width: 300.0,
|
||||
height: 80.0,
|
||||
child: Container(
|
||||
child: TextFormField(
|
||||
controller: _comment,
|
||||
autofocus: false,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: 3,
|
||||
style: textStyle,
|
||||
decoration: new InputDecoration(
|
||||
labelText: "Comment",
|
||||
labelStyle: labelStyle,
|
||||
icon: Icon(
|
||||
Icons.add_comment,
|
||||
color: primaryColor,
|
||||
),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return "Please enter comment";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(
|
||||
"Cancel",
|
||||
style: labelStyle,
|
||||
),
|
||||
onPressed: () {
|
||||
_comment.clear();
|
||||
Navigator.of(context).pop();
|
||||
}),
|
||||
FlatButton(
|
||||
color: primaryColor,
|
||||
child: Text("Submit",
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontWeight: FontWeight.bold)),
|
||||
onPressed: () {
|
||||
commentCallback(_comment.text);
|
||||
Navigator.of(context).pop();
|
||||
})
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget getStatus(String status) {
|
||||
return status == "Delivered"
|
||||
? Text(status,
|
||||
|
||||
@@ -5,6 +5,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/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -49,7 +50,12 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("rate.title")),
|
||||
title: LocalText(
|
||||
context,
|
||||
"rate.title",
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
||||
@@ -7,20 +7,11 @@ import 'package:fcs/domain/vo/radio.dart';
|
||||
import 'package:fcs/pages/main/model/base_model.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class PickUpModel extends BaseModel {
|
||||
final log = Logger('PickUpModel');
|
||||
class ShipmentModel extends BaseModel {
|
||||
final log = Logger('ShipmentModel');
|
||||
|
||||
StreamSubscription<QuerySnapshot> listener;
|
||||
|
||||
// var profile = FCSProfile(
|
||||
// id: '1',
|
||||
// usaAddress: '154-19 64th Ave.\nFlushing, NY 11367',
|
||||
// mmAddress: 'FCS Trading Myanmar\nRoom 333, Yangon',
|
||||
// usaContactNumber: '1 (929) 215-2247',
|
||||
// mmContactNumber: '+95 9 700224723',
|
||||
// mail: 'admin@fcs.com',
|
||||
// facebook: 'https://facebook.com/fcs');
|
||||
|
||||
List<RadioGroup> radioGroups1 = [
|
||||
RadioGroup(
|
||||
text: "FCS Pickup",
|
||||
@@ -62,9 +53,9 @@ class PickUpModel extends BaseModel {
|
||||
return radioGroups;
|
||||
}
|
||||
|
||||
List<PickUp> get pickups {
|
||||
List<PickUp> pickups = [
|
||||
PickUp(
|
||||
List<Shipment> get pickups {
|
||||
List<Shipment> pickups = [
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -83,7 +74,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -100,7 +91,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -118,7 +109,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -135,7 +126,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -152,7 +143,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -169,7 +160,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 10 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -186,7 +177,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 6 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -207,8 +198,8 @@ class PickUpModel extends BaseModel {
|
||||
return pickups;
|
||||
}
|
||||
|
||||
List<PickUp> pickups1 = [
|
||||
PickUp(
|
||||
List<Shipment> pickups1 = [
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -227,7 +218,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -244,7 +235,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -262,7 +253,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200412 - 12 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -279,7 +270,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200125 - 12 May 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -296,7 +287,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 13 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -313,7 +304,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 10 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -330,7 +321,7 @@ class PickUpModel extends BaseModel {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
]),
|
||||
PickUp(
|
||||
Shipment(
|
||||
id: "S200441 - 6 Apr 2020",
|
||||
userName: "Ko Kyaw Nyi",
|
||||
phoneNumber: '+959111111111',
|
||||
@@ -349,22 +340,22 @@ class PickUpModel extends BaseModel {
|
||||
]),
|
||||
];
|
||||
|
||||
List<PickUp> get canceled {
|
||||
List<PickUp> _p = pickups.where((e) => e.status == "Canceled").toList()
|
||||
List<Shipment> get canceled {
|
||||
List<Shipment> _p = pickups.where((e) => e.status == "Canceled").toList()
|
||||
..sort((e1, e2) {
|
||||
return e2.date.compareTo(e1.date);
|
||||
});
|
||||
return _p;
|
||||
}
|
||||
|
||||
List<PickUp> get completed {
|
||||
List<Shipment> get completed {
|
||||
return pickups.where((e) => e.status == "Pickuped").toList()
|
||||
..sort((e1, e2) {
|
||||
return e2.date.compareTo(e1.date);
|
||||
});
|
||||
}
|
||||
|
||||
List<PickUp> get upcoming {
|
||||
List<Shipment> get upcoming {
|
||||
return pickups
|
||||
.where((e) =>
|
||||
e.status == "Pending" ||
|
||||
@@ -6,7 +6,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/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/shipment/model/pickup_model.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/shipment_address/model/shipment_address_model.dart';
|
||||
import 'package:fcs/pages/shipment_address/shipping_address_row.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
@@ -24,15 +24,15 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'pickup_box_editor.dart';
|
||||
|
||||
class PickUpEditor extends StatefulWidget {
|
||||
final PickUp pickUp;
|
||||
PickUpEditor({this.pickUp});
|
||||
class ShipmentEditor extends StatefulWidget {
|
||||
final Shipment pickUp;
|
||||
ShipmentEditor({this.pickUp});
|
||||
|
||||
@override
|
||||
_PickUpEditorState createState() => _PickUpEditorState();
|
||||
_ShipmentEditorState createState() => _ShipmentEditorState();
|
||||
}
|
||||
|
||||
class _PickUpEditorState extends State<PickUpEditor> {
|
||||
class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final numberFormatter = new NumberFormat("#,###");
|
||||
MultiImgController multiImgController = MultiImgController();
|
||||
@@ -53,7 +53,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
TextEditingController _pickupDate = new TextEditingController();
|
||||
TextEditingController _handlingFeeController = new TextEditingController();
|
||||
|
||||
PickUp _pickUp;
|
||||
Shipment _pickUp;
|
||||
bool _isLoading = false;
|
||||
var now = new DateTime.now();
|
||||
bool isNew;
|
||||
@@ -88,7 +88,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
Cargo(type: 'Medicine', weight: 20),
|
||||
Cargo(type: 'Dangerous Cargo', weight: 30)
|
||||
];
|
||||
_pickUp = PickUp(cargoTypes: _cargoTypes);
|
||||
_pickUp = Shipment(cargoTypes: _cargoTypes);
|
||||
}
|
||||
var shipmentModel =
|
||||
Provider.of<ShipmentAddressModel>(context, listen: false);
|
||||
@@ -102,7 +102,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
|
||||
final fromTimeBox = fcsInput(
|
||||
'From',
|
||||
@@ -1,21 +1,21 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/shipment/model/pickup_model.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/progress.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'pickup_editor.dart';
|
||||
import 'pickup_list_row.dart';
|
||||
import 'shipment_editor.dart';
|
||||
import 'shipment_list_row.dart';
|
||||
|
||||
class PickUpList extends StatefulWidget {
|
||||
class ShipmentList extends StatefulWidget {
|
||||
@override
|
||||
_PickUpListState createState() => _PickUpListState();
|
||||
_ShipmentListState createState() => _ShipmentListState();
|
||||
}
|
||||
|
||||
class _PickUpListState extends State<PickUpList> {
|
||||
class _ShipmentListState extends State<ShipmentList> {
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
@@ -30,7 +30,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: DefaultTabController(
|
||||
@@ -82,7 +82,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.pickups.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.pickups[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.pickups[index]);
|
||||
}),
|
||||
// body: TabBarView(
|
||||
// children: [
|
||||
@@ -98,11 +98,11 @@ class _PickUpListState extends State<PickUpList> {
|
||||
}
|
||||
|
||||
_newPickup() {
|
||||
Navigator.of(context).push(BottomUpPageRoute(PickUpEditor()));
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentEditor()));
|
||||
}
|
||||
|
||||
Widget _upComing() {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
@@ -115,7 +115,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.upcoming.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.upcoming[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.upcoming[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
@@ -123,7 +123,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
}
|
||||
|
||||
Widget _completed() {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
@@ -136,7 +136,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.completed.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.completed[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.completed[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
@@ -144,7 +144,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
}
|
||||
|
||||
Widget _canceled() {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
@@ -157,7 +157,7 @@ class _PickUpListState extends State<PickUpList> {
|
||||
shrinkWrap: true,
|
||||
itemCount: pickupModel.canceled.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return PickupListRow(pickUp: pickupModel.canceled[index]);
|
||||
return ShipmentListRow(pickUp: pickupModel.canceled[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
@@ -5,19 +5,19 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
|
||||
import '../main/util.dart';
|
||||
import 'pickup_editor.dart';
|
||||
import 'shipment_editor.dart';
|
||||
|
||||
class PickupListRow extends StatefulWidget {
|
||||
final PickUp pickUp;
|
||||
const PickupListRow({this.pickUp});
|
||||
class ShipmentListRow extends StatefulWidget {
|
||||
final Shipment pickUp;
|
||||
const ShipmentListRow({this.pickUp});
|
||||
|
||||
@override
|
||||
_PickupListRowState createState() => _PickupListRowState();
|
||||
_ShipmentListRowState createState() => _ShipmentListRowState();
|
||||
}
|
||||
|
||||
class _PickupListRowState extends State<PickupListRow> {
|
||||
class _ShipmentListRowState extends State<ShipmentListRow> {
|
||||
final double dotSize = 15.0;
|
||||
PickUp _pickUp = new PickUp();
|
||||
Shipment _pickUp = new Shipment();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -41,7 +41,7 @@ class _PickupListRowState extends State<PickupListRow> {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.push(BottomUpPageRoute(PickUpEditor(pickUp: _pickUp)));
|
||||
.push(BottomUpPageRoute(ShipmentEditor(pickUp: _pickUp)));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Reference in New Issue
Block a user