clean up localization
This commit is contained in:
@@ -2,6 +2,8 @@ import 'package:fcs/domain/entities/discount.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/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
@@ -42,6 +44,24 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final codeBox = InputText(
|
||||
labelTextKey: 'discount.code',
|
||||
iconData: FontAwesomeIcons.algolia,
|
||||
controller: _codeController);
|
||||
final nameBox = InputText(
|
||||
labelTextKey: 'discount.name',
|
||||
iconData: Feather.user,
|
||||
controller: _customerController);
|
||||
final amountBox = InputText(
|
||||
labelTextKey: 'discount.amount',
|
||||
iconData: FontAwesomeIcons.moneyBill,
|
||||
controller: _amountController);
|
||||
final statusBox = DisplayText(
|
||||
text: _statusController.text,
|
||||
labelText: getLocalString(context, "discount.status"),
|
||||
iconData: Icons.av_timer,
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -65,32 +85,14 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput('Code', FontAwesomeIcons.algolia,
|
||||
controller: _codeController),
|
||||
fcsInput('Customer Name', Feather.user,
|
||||
controller: _customerController),
|
||||
fcsInput('Amount', FontAwesomeIcons.moneyBill,
|
||||
controller: _amountController),
|
||||
codeBox,
|
||||
nameBox,
|
||||
amountBox,
|
||||
widget.discount == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: TextFormField(
|
||||
controller: _statusController,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Status',
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 16, color: primaryColor),
|
||||
filled: true,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
icon: Icon(
|
||||
Icons.av_timer,
|
||||
color: primaryColor,
|
||||
),
|
||||
)),
|
||||
child: statusBox,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -68,7 +68,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("payment.title")),
|
||||
title: Text(AppTranslations.of(context).text("pm_.title")),
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
@@ -78,7 +78,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
LocalText(context, 'total.amount',
|
||||
LocalText(context, 'pm.total.amount',
|
||||
color: Colors.black, fontSize: 16),
|
||||
Text(
|
||||
' \$ ${_invoice.amount}',
|
||||
@@ -95,7 +95,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
LocalText(context, 'remaining_balance',
|
||||
LocalText(context, 'pm.remaining_balance',
|
||||
color: Colors.black, fontSize: 16),
|
||||
Text(
|
||||
' \$ ${_invoice.amount - _invoice.receipts[0].amount}',
|
||||
@@ -111,7 +111,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
child: ListView(
|
||||
children: [
|
||||
ExpansionTile(
|
||||
title: LocalText(context, 'payment.attachment',
|
||||
title: LocalText(context, 'pm.attachment',
|
||||
color: Colors.black, fontSize: 16),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
@@ -144,7 +144,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
title: LocalText(context, 'payment.receipt',
|
||||
title: LocalText(context, 'pm.receipt',
|
||||
color: Colors.black, fontSize: 16),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
@@ -157,14 +157,14 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"payment.date",
|
||||
"pm.date",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"payment.amount",
|
||||
"pm.amount",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -54,7 +54,7 @@ Future<void> showConfirmDialog(
|
||||
FlatButton(
|
||||
color: Colors.grey[300],
|
||||
child: Text(
|
||||
AppTranslations.of(context).text('Cancel'),
|
||||
AppTranslations.of(context).text('btn.cancel'),
|
||||
style: Provider.of<LanguageModel>(context).isEng
|
||||
? TextStyle()
|
||||
: TextStyle(fontFamily: 'Myanmar3'),
|
||||
@@ -67,7 +67,7 @@ Future<void> showConfirmDialog(
|
||||
),
|
||||
FlatButton(
|
||||
color: primaryColor,
|
||||
child: Text(AppTranslations.of(context).text('Ok'),
|
||||
child: Text(AppTranslations.of(context).text('btn.ok'),
|
||||
style: Provider.of<LanguageModel>(context).isEng
|
||||
? TextStyle(
|
||||
color: Colors.white,
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:fcs/pages/package/tracking_id_page.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
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';
|
||||
@@ -69,12 +70,15 @@ class _PackageEditorPageState extends State<PackageEditorPage> {
|
||||
getLocalString(context, 'package.edit.complete.process.btn'),
|
||||
callack: _completeProcessing,
|
||||
);
|
||||
final descBox = fcsInput(getLocalString(context, "package.edit.desc"),
|
||||
MaterialCommunityIcons.message_text_outline,
|
||||
controller: _descCtl, autoFocus: false);
|
||||
final remarkBox = fcsInput(
|
||||
getLocalString(context, "package.edit.remark"), Entypo.new_message,
|
||||
controller: _remarkCtl, autoFocus: false);
|
||||
final descBox = InputText(
|
||||
labelTextKey: 'package.edit.desc',
|
||||
iconData: MaterialCommunityIcons.message_text_outline,
|
||||
controller: _descCtl);
|
||||
final remarkBox = InputText(
|
||||
labelTextKey: 'package.edit.remark',
|
||||
iconData: Entypo.new_message,
|
||||
controller: _remarkCtl);
|
||||
|
||||
final img = MultiImageFile(
|
||||
enabled: true,
|
||||
controller: multiImgController,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/rate.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/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -37,6 +38,14 @@ class _CargoEditorState extends State<CargoEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final typeBox = InputText(
|
||||
labelTextKey: 'cargo.type',
|
||||
iconData: Icons.text_format,
|
||||
controller: _descController);
|
||||
final rateBox = InputText(
|
||||
labelTextKey: 'cargo.rate',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _rateController);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -58,10 +67,8 @@ class _CargoEditorState extends State<CargoEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Cargo Type", Icons.text_format,
|
||||
controller: _descController),
|
||||
fcsInput("Rate", Icons.attach_money,
|
||||
controller: _rateController),
|
||||
typeBox,
|
||||
rateBox,
|
||||
SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/custom.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/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -38,6 +39,14 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final productBox = InputText(
|
||||
labelTextKey: 'rate.cutom.product_type',
|
||||
iconData: FontAwesomeIcons.weightHanging,
|
||||
controller: _productController);
|
||||
final feeBox = InputText(
|
||||
labelTextKey: 'rate.custom.fee',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _feeController);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -50,7 +59,8 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("custom.form.title")),
|
||||
title:
|
||||
Text(AppTranslations.of(context).text("rate.custom.form.title")),
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(18),
|
||||
@@ -59,10 +69,8 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Procut Type", FontAwesomeIcons.weightHanging,
|
||||
controller: _productController),
|
||||
fcsInput("Fee", Icons.attach_money,
|
||||
controller: _feeController),
|
||||
productBox,
|
||||
feeBox,
|
||||
SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/discount.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/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -38,6 +39,16 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
final weightBox = InputText(
|
||||
labelTextKey: 'rate.discount.weight',
|
||||
iconData: FontAwesomeIcons.weightHanging,
|
||||
controller: _weightController);
|
||||
final discountRateBox = InputText(
|
||||
labelTextKey: 'rate.discount.rate',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _rateController);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -59,10 +70,8 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Weight", FontAwesomeIcons.weightHanging,
|
||||
controller: _weightController),
|
||||
fcsInput("Discount Rate", Icons.attach_money,
|
||||
controller: _rateController),
|
||||
weightBox,
|
||||
discountRateBox,
|
||||
SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,6 +6,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/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -27,10 +28,16 @@ class ShipmentRatesEdit extends StatefulWidget {
|
||||
|
||||
class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
bool _isLoading = false;
|
||||
TextEditingController _minWeight = new TextEditingController();
|
||||
TextEditingController _deliveryFee = new TextEditingController();
|
||||
TextEditingController _volumetricRatio = new TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_minWeight.text = "10";
|
||||
_deliveryFee.text = "5";
|
||||
_volumetricRatio.text = "166.36";
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -42,6 +49,19 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
|
||||
|
||||
final minWigBox = InputText(
|
||||
labelTextKey: 'rate.min_weight',
|
||||
iconData: FontAwesomeIcons.weightHanging,
|
||||
controller: _minWeight);
|
||||
final feeBox = InputText(
|
||||
labelTextKey: 'rate.delivery_fee',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _deliveryFee);
|
||||
final ratioBox = InputText(
|
||||
labelTextKey: 'rate.volumetric_ratio',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _volumetricRatio);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -63,13 +83,16 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Min Weight for Free delivery within Yangon",
|
||||
FontAwesomeIcons.weightHanging,
|
||||
value: "10"),
|
||||
fcsInput("Delivery fees", Icons.attach_money, value: "5"),
|
||||
SizedBox(height: 10),
|
||||
fcsInput("Volumetric Ratio", Icons.attach_money,
|
||||
value: "166.36"),
|
||||
minWigBox,
|
||||
feeBox,
|
||||
ratioBox,
|
||||
// fcsInput("Min Weight for Free delivery within Yangon",
|
||||
// FontAwesomeIcons.weightHanging,
|
||||
// value: "10"),
|
||||
// fcsInput("Delivery fees", Icons.attach_money, value: "5"),
|
||||
// SizedBox(height: 10),
|
||||
// fcsInput("Volumetric Ratio", Icons.attach_money,
|
||||
// value: "166.36"),
|
||||
SizedBox(height: 10),
|
||||
ExpansionTile(
|
||||
title: Text(
|
||||
|
||||
Reference in New Issue
Block a user