update rate

This commit is contained in:
PhyoThandar
2020-10-15 15:49:02 +06:30
parent 47c07a6c88
commit 2a401f2e1f
17 changed files with 937 additions and 295 deletions

View File

@@ -49,11 +49,20 @@ class _CustomListState extends State<CustomList> {
backgroundColor: primaryColor,
title: LocalText(
context,
"Customs",
"rate.custom_duty.title",
fontSize: 20,
color: Colors.white,
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
Navigator.of(context).push(
CupertinoPageRoute(builder: (context) => CustomEditor()));
},
icon: Icon(Icons.add, color: Colors.white),
backgroundColor: primaryColor,
label:
LocalText(context, 'rate.custom_duty', color: Colors.white)),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView.separated(
@@ -62,26 +71,46 @@ class _CustomListState extends State<CustomList> {
),
itemCount: shipmentRateModel.rate.customDuties.length,
itemBuilder: (context, index) {
return _row(
context, shipmentRateModel.rate.customDuties[index]);
CustomDuty custom =
shipmentRateModel.rate.customDuties[index];
return InkWell(
onTap: () {
Navigator.of(context).push(CupertinoPageRoute(
builder: (context) => CustomEditor(custom: custom)));
},
child: Container(
child: _row(
custom.productType, "\$ " + custom.fee.toString()),
),
);
}),
)),
);
}
_row(BuildContext context, CustomDuty custom) {
return InkWell(
onTap: () => Navigator.pop<CustomDuty>(context, custom),
child: Row(
children: [
Expanded(
child: CustomRow(
key: ValueKey(custom.id),
custom: custom,
_row(String desc, String price) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
],
),
),
],
),
);
SizedBox(
width: 50,
),
],
));
}
}