clean up localization

This commit is contained in:
Thinzar Win
2020-10-07 18:49:28 +06:30
parent aeb0d22cd3
commit 99e4c08414
10 changed files with 373 additions and 1105 deletions

View File

@@ -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),
],
),

View File

@@ -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),
],
),

View File

@@ -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),
],
),

View File

@@ -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(