import 'package:fcs/domain/entities/custom_duty.dart'; import 'package:fcs/domain/vo/delivery_address.dart'; import 'package:fcs/helpers/theme.dart'; import 'package:fcs/pages/delivery_address/delivery_address_editor.dart'; import 'package:fcs/pages/main/util.dart'; import 'package:fcs/pages/rates/custom_editor.dart'; import 'package:fcs/pages/widgets/bottom_up_page_route.dart'; import 'package:fcs/pages/widgets/local_text.dart'; import 'package:fcs/pages/widgets/progress.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'custom_row.dart'; import 'model/shipment_rate_model.dart'; class CustomList extends StatefulWidget { const CustomList({Key key}) : super(key: key); @override _CustomListState createState() => _CustomListState(); } class _CustomListState extends State { bool _isLoading = false; @override void initState() { super.initState(); } @override void dispose() { super.dispose(); } @override Widget build(BuildContext context) { var shipmentRateModel = Provider.of(context); 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, "Customs", fontSize: 20, color: Colors.white, ), ), body: Padding( padding: const EdgeInsets.all(8.0), child: ListView.separated( separatorBuilder: (c, i) => Divider( color: primaryColor, ), itemCount: shipmentRateModel.rate.customDuties.length, itemBuilder: (context, index) { return _row( context, shipmentRateModel.rate.customDuties[index]); }), )), ); } _row(BuildContext context, CustomDuty custom) { return InkWell( onTap: () => Navigator.pop(context, custom), child: Row( children: [ Expanded( child: CustomRow( key: ValueKey(custom.id), custom: custom, ), ), ], ), ); } }