update rate
This commit is contained in:
@@ -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,
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user