merge material 3
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import 'package:fcs/domain/entities/cargo_type.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_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -56,27 +55,25 @@ class _CargoEditorState extends State<CargoEditor> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "cargo.form.title",
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor,
|
||||
onBack: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context)!.text("cargo.form.title")),
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
actions: [
|
||||
_isNew
|
||||
? Container()
|
||||
: IconButton(
|
||||
icon: Icon(Icons.delete),
|
||||
icon: Icon(Icons.delete, color: primaryColor),
|
||||
onPressed: _delete,
|
||||
)
|
||||
],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -35,20 +36,7 @@ class _CargoTypeListState extends State<CargoTypeList> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(
|
||||
context,
|
||||
"cargo.form.title",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
appBar: LocalAppBar(labelKey: "cargo.form.title"),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import 'package:fcs/domain/entities/cargo_type.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_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -64,30 +63,25 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(
|
||||
CupertinoIcons.back,
|
||||
),
|
||||
onPressed: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
appBar: LocalAppBar(
|
||||
labelKey: 'rate.custom.form.title',
|
||||
backgroundColor: Colors.white,
|
||||
arrowColor: primaryColor,
|
||||
labelColor: primaryColor,
|
||||
onBack: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title:
|
||||
Text(AppTranslations.of(context)!.text("rate.custom.form.title")),
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
actions: [
|
||||
_isNew
|
||||
? Container()
|
||||
: IconButton(
|
||||
icon: Icon(Icons.delete),
|
||||
icon: Icon(Icons.delete, color: primaryColor),
|
||||
onPressed: _delete,
|
||||
)
|
||||
],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/rates/custom_editor.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -39,20 +40,7 @@ class _CustomListState extends State<CustomList> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(
|
||||
context,
|
||||
"rate.custom_duty.title",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
appBar: LocalAppBar(labelKey: 'rate.custom_duty.title'),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(
|
||||
@@ -81,8 +69,9 @@ class _CustomListState extends State<CustomList> {
|
||||
},
|
||||
child: Container(
|
||||
child: _row(
|
||||
custom.name??"",
|
||||
"Custom Fee \$ " + custom.customDutyFee.toStringAsFixed(2),
|
||||
custom.name ?? "",
|
||||
"Custom Fee \$ " +
|
||||
custom.customDutyFee.toStringAsFixed(2),
|
||||
// ignore: unnecessary_null_comparison
|
||||
custom.rate == null
|
||||
? ""
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:fcs/domain/entities/discount_by_weight.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/rates/discount_by_weight_editor.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -35,20 +36,7 @@ class _DiscountByWeightListState extends State<DiscountByWeightList> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(
|
||||
context,
|
||||
"rate.discount_by_weight",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
appBar: LocalAppBar(labelKey: 'rate.discount_by_weight'),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(CupertinoPageRoute(
|
||||
@@ -86,7 +74,7 @@ class _DiscountByWeightListState extends State<DiscountByWeightList> {
|
||||
|
||||
_row(String desc, String price) {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
|
||||
padding: EdgeInsets.only(left: 25, top: 8, bottom: 8),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text('$desc ', style: TextStyle(fontSize: 15)),
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import 'package:fcs/domain/entities/discount_by_weight.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/rates/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -58,27 +57,25 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
appBar: LocalAppBar(
|
||||
labelKey: 'discount.new',
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor,
|
||||
onBack: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context)!.text("discount.new")),
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
actions: [
|
||||
_isNew
|
||||
? Container()
|
||||
: IconButton(
|
||||
icon: Icon(Icons.delete),
|
||||
icon: Icon(Icons.delete, color: primaryColor),
|
||||
onPressed: _delete,
|
||||
)
|
||||
],
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/rates/cargo_type_list.dart';
|
||||
import 'package:fcs/pages/rates/custom_list.dart';
|
||||
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -46,33 +47,23 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
shadowColor: Colors.transparent,
|
||||
title: LocalText(context, 'rate.title',
|
||||
color: primaryColor, fontSize: 20),
|
||||
actions: isEditable
|
||||
? [
|
||||
IconButton(
|
||||
onPressed: () => Navigator.of(context).push(
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ShipmentRatesEdit())),
|
||||
icon: Icon(
|
||||
Icons.edit,
|
||||
color: primaryColor,
|
||||
))
|
||||
]
|
||||
: [],
|
||||
),
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "rate.title",
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor,
|
||||
actions: isEditable
|
||||
? [
|
||||
IconButton(
|
||||
onPressed: () => Navigator.of(context).push(
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ShipmentRatesEdit())),
|
||||
icon: Icon(Icons.edit, color: primaryColor))
|
||||
]
|
||||
: []),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
fcsButton(context, getLocalString(context, "rate.cal.title"),
|
||||
callack: () {
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/length_picker.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/local_dropdown.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
@@ -53,9 +54,9 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
_calShipmentWeight() {
|
||||
Rate rate = Provider.of<ShipmentRateModel>(context, listen: false).rate;
|
||||
|
||||
double l = double.parse(_lengthController.text);
|
||||
double w = double.parse(_widthController.text);
|
||||
double h = double.parse(_heightController.text);
|
||||
double l = double.tryParse(_lengthController.text) ?? 0;
|
||||
double w = double.tryParse(_widthController.text) ?? 0;
|
||||
double h = double.tryParse(_heightController.text) ?? 0;
|
||||
_cargoType.weight = double.tryParse(_actualWeightCtl.text) ?? 0;
|
||||
Carton box =
|
||||
Carton(cargoTypes: [_cargoType], length: l, width: w, height: h);
|
||||
@@ -137,19 +138,11 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
shadowColor: Colors.transparent,
|
||||
title: LocalText(context, 'rate.cal.title',
|
||||
color: primaryColor, fontSize: 20),
|
||||
),
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "rate.cal.title",
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ListView(
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import 'package:fcs/domain/entities/rate.dart';
|
||||
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/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -73,24 +72,20 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(
|
||||
CupertinoIcons.back,
|
||||
),
|
||||
onPressed: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "rate.edit.title",
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor,
|
||||
onBack: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context)!.text("rate.edit.title")),
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(18),
|
||||
|
||||
Reference in New Issue
Block a user