From 89df7a716b93f6957f8c2174cccf31ee996f1c7b Mon Sep 17 00:00:00 2001 From: PhyoThandar Date: Tue, 2 Jun 2020 15:21:26 +0630 Subject: [PATCH] modify --- assets/local/localization_en.json | 2 +- assets/local/localization_mu.json | 5 +++- lib/pages/shipment_rates.dart | 31 +++++-------------------- lib/pages/shipment_rates_calculate.dart | 31 +++++++++++++++++++------ lib/pages/shipment_rates_edit.dart | 29 ++--------------------- 5 files changed, 37 insertions(+), 61 deletions(-) diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json index c556e3b..f63c83f 100644 --- a/assets/local/localization_en.json +++ b/assets/local/localization_en.json @@ -552,7 +552,7 @@ "contact": "CONTACTS", - "fcs.profile": "FCS PROFILE", + "fcs.profile": "PROFILE", "contact.usa.phone": "USA Phone", "contact.mm.phone": "Myanmar Phone" diff --git a/assets/local/localization_mu.json b/assets/local/localization_mu.json index 962456a..6fd623d 100644 --- a/assets/local/localization_mu.json +++ b/assets/local/localization_mu.json @@ -558,6 +558,9 @@ "rate":"အဆင့်သတ်မှတ်ချက်များ", "rate.title":"အဆင့်သတ်မှတ်ချက်များ", + "rate.edit.title":"အဆင့်သတ်မှတ်ချက်များပြုပြင်ရန်", + + "rate.cal.title":"အဆင့်သတ်မှတ်ချက်များတွက်ချက်ရန်", "message.btn":"မက်ဆေ့ခ်ျများ", "message.title":"မက်ဆေ့ခ်ျများ", @@ -580,7 +583,7 @@ "contact": "ဆက်သွယ်ရန်", - "fcs.profile": "FCS ပရိုဖိုင်", + "fcs.profile": "ပရိုဖိုင်", "contact.usa.phone": "ယူအက်စ်အေ ဖုန်းနံပါတ်", "contact.mm.phone": "မြန်မာ ဖုန်းနံပါတ်" diff --git a/lib/pages/shipment_rates.dart b/lib/pages/shipment_rates.dart index 8a82b15..b78d69a 100644 --- a/lib/pages/shipment_rates.dart +++ b/lib/pages/shipment_rates.dart @@ -2,6 +2,7 @@ import 'package:fcs/model/pickup_model.dart'; import 'package:fcs/model/shipment_rate_model.dart'; import 'package:fcs/pages/shipment_rates_calculate.dart'; import 'package:fcs/pages/shipment_rates_edit.dart'; +import 'package:fcs/pages/term.dart'; import 'package:fcs/vo/pickup.dart'; import 'package:provider/provider.dart'; import 'package:fcs/widget/localization/app_translations.dart'; @@ -31,14 +32,6 @@ class _ShipmentRatesState extends State { PickUp _pickUp; bool _isLoading = false; - List texts = [ - "Minimum shipping weight is 1lbs.", - "Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on specifications. Please contact us for pricing.", - "Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.", - "Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.", - "Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.", - "Payments made in Myanmar will incur 2% tranfer fee" - ]; @override void initState() { @@ -62,13 +55,6 @@ class _ShipmentRatesState extends State { Widget build(BuildContext context) { var shipmentRateModel = Provider.of(context); - var textList = texts - .map( - (e) => TextSpan( - text: "\n * " + e + "\n", - style: TextStyle(fontWeight: FontWeight.normal, fontSize: 13)), - ) - .toList(); final usaAddress = Container( child: TextFormField( maxLines: null, @@ -116,16 +102,11 @@ class _ShipmentRatesState extends State { ), _row("Free delivery within Yangon \nfor shipments over","10","pounds"), _row("Delivery fees","\$ 5","below 10 pounds"), - // Padding( - // padding: const EdgeInsets.only(left: 18.0, right: 18), - // child: RichText( - // // overflow: TextOverflow.fade, - // text: TextSpan( - // style: TextStyle(color: primaryColor), - // children: textList, - // ), - // ), - // ), + + fcsButton(context, "Terms & Conditions", callack: () { + Navigator.of(context) + .push(MaterialPageRoute(builder: (_) => Term())); + }), fcsButton(context, "Calculate", callack: () { Navigator.of(context) .push(MaterialPageRoute(builder: (_) => ShipmentRatesCal())); diff --git a/lib/pages/shipment_rates_calculate.dart b/lib/pages/shipment_rates_calculate.dart index 045c7b2..ce6b86b 100644 --- a/lib/pages/shipment_rates_calculate.dart +++ b/lib/pages/shipment_rates_calculate.dart @@ -58,8 +58,14 @@ class _ShipmentRatesCalState extends State { child: Scaffold( appBar: AppBar( centerTitle: true, + leading: new IconButton( + icon: new Icon( + Icons.close, + ), + onPressed: () => Navigator.of(context).pop(), + ), backgroundColor: primaryColor, - title: Text(AppTranslations.of(context).text("rate.title")), + title: Text(AppTranslations.of(context).text("rate.cal.title")), ), body: Padding( padding: const EdgeInsets.all(8.0), @@ -77,13 +83,22 @@ class _ShipmentRatesCalState extends State { shipmentRateModel.rates[index].price.toString() + " per pound", '', - "",input: true); + "", + input: true); }), ), SizedBox(height: 50), - Center(child: Text("Delivery fee:\$ 5",style: TextStyle(color:primaryColor,fontSize:16),)), + Center( + child: Text( + "Delivery fee:\$ 5", + style: TextStyle(color: primaryColor, fontSize: 16), + )), SizedBox(height: 20), - Center(child: Text("Total estimated amount:\$ 38",style: TextStyle(color:primaryColor,fontSize:20),)) + Center( + child: Text( + "Total estimated amount:\$ 38", + style: TextStyle(color: primaryColor, fontSize: 20), + )) ], ), ), @@ -91,7 +106,7 @@ class _ShipmentRatesCalState extends State { ); } - _row(String desc, String price, String unit,{bool input}) { + _row(String desc, String price, String unit, {bool input}) { return Container( padding: EdgeInsets.only(left: 25, top: 5, bottom: 5), child: Row( @@ -119,8 +134,10 @@ class _ShipmentRatesCalState extends State { width: 50, ), Container( - width: 70, - child: TextField(textAlign: TextAlign.end,)), + width: 70, + child: TextField( + textAlign: TextAlign.end, + )), ], )); } diff --git a/lib/pages/shipment_rates_edit.dart b/lib/pages/shipment_rates_edit.dart index 2bc1af1..50ff469 100644 --- a/lib/pages/shipment_rates_edit.dart +++ b/lib/pages/shipment_rates_edit.dart @@ -30,14 +30,6 @@ class _ShipmentRatesEditState extends State { PickUp _pickUp; bool _isLoading = false; - List texts = [ - "Minimum shipping weight is 1lbs.", - "Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on specifications. Please contact us for pricing.", - "Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.", - "Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.", - "Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.", - "Payments made in Myanmar will incur 2% tranfer fee" - ]; @override void initState() { @@ -61,14 +53,6 @@ class _ShipmentRatesEditState extends State { Widget build(BuildContext context) { var shipmentRateModel = Provider.of(context); - var textList = texts - .map( - (e) => TextSpan( - text: "\n * " + e + "\n", - style: TextStyle(fontWeight: FontWeight.normal, fontSize: 13)), - ) - .toList(); - return LocalProgress( inAsyncCall: _isLoading, child: Scaffold( @@ -88,7 +72,7 @@ class _ShipmentRatesEditState extends State { child: ListView( children: [ Container( - height: 145, + height: 190, child: ListView.builder( itemCount: shipmentRateModel.rates.length, itemBuilder: (context, index) { @@ -103,16 +87,7 @@ class _ShipmentRatesEditState extends State { FontAwesomeIcons.weightHanging, value: "10"), fcsInput("Delivery fees", Icons.attach_money, value: "5"), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8), - child: RichText( - // overflow: TextOverflow.fade, - text: TextSpan( - style: TextStyle(color: primaryColor), - children: textList, - ), - ), - ), + SizedBox(height: 10), fcsButton(context, "Save", callack: () {}), SizedBox(height: 10) ],