update carton and cargo type
This commit is contained in:
@@ -13,12 +13,14 @@ import 'fcs_shipment_editor.dart';
|
||||
import 'fcs_shipment_list_row.dart';
|
||||
|
||||
class FcsShipmentList extends StatefulWidget {
|
||||
const FcsShipmentList({super.key});
|
||||
|
||||
@override
|
||||
_FcsShipmentListState createState() => _FcsShipmentListState();
|
||||
}
|
||||
|
||||
class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
bool _isLoading = false;
|
||||
bool isLoading = false;
|
||||
int _selectedIndex = 0;
|
||||
|
||||
@override
|
||||
@@ -41,7 +43,7 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
inAsyncCall: isLoading,
|
||||
child: Scaffold(
|
||||
appBar: LocalAppBar(labelKey: "FCSshipment.list.title", actions: [
|
||||
_menuFilteringWidget(context),
|
||||
@@ -66,63 +68,68 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
}
|
||||
|
||||
Widget _menuFilteringWidget(BuildContext context) {
|
||||
return PopupMenuButton<LocalPopupMenu>(
|
||||
splashRadius: 25,
|
||||
padding: const EdgeInsets.only(right: 15),
|
||||
elevation: 3.2,
|
||||
tooltip: 'This is tooltip',
|
||||
onSelected: (choice) async {
|
||||
setState(() {
|
||||
_selectedIndex = choice.id;
|
||||
});
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 5),
|
||||
child: PopupMenuButton<LocalPopupMenu>(
|
||||
elevation: 3.2,
|
||||
tooltip: '',
|
||||
onSelected: (choice) async {
|
||||
setState(() {
|
||||
_selectedIndex = choice.id;
|
||||
});
|
||||
|
||||
await context.read<FcsShipmentModel>().onChanged(choice.id);
|
||||
},
|
||||
icon: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
const Icon(
|
||||
Icons.filter_list,
|
||||
color: Colors.white,
|
||||
await context.read<FcsShipmentModel>().onChanged(choice.id);
|
||||
},
|
||||
icon: SizedBox(
|
||||
width: 30,
|
||||
height: 30,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
const Icon(
|
||||
Icons.filter_list,
|
||||
color: Colors.white,
|
||||
),
|
||||
_selectedIndex != 0
|
||||
? Positioned(
|
||||
bottom: 15,
|
||||
right: 0,
|
||||
child: Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
_selectedIndex != 0
|
||||
? Positioned(
|
||||
bottom: 15,
|
||||
right: 0,
|
||||
child: Container(
|
||||
),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return shipFiteringMenu.map((LocalPopupMenu choice) {
|
||||
return PopupMenuItem<LocalPopupMenu>(
|
||||
value: choice,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Text("${choice.text}",
|
||||
style: TextStyle(color: Colors.black))),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return shipFiteringMenu.map((LocalPopupMenu choice) {
|
||||
return PopupMenuItem<LocalPopupMenu>(
|
||||
value: choice,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Text("${choice.text}",
|
||||
style: TextStyle(color: Colors.black))),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
_selectedIndex == choice.id
|
||||
? const Icon(
|
||||
Icons.check,
|
||||
color: Colors.grey,
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
});
|
||||
_selectedIndex == choice.id
|
||||
? const Icon(
|
||||
Icons.check,
|
||||
color: Colors.grey,
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import 'fcs_shipment_info.dart';
|
||||
|
||||
class FcsShipmentListRow extends StatelessWidget {
|
||||
final FcsShipment shipment;
|
||||
final dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
FcsShipmentListRow({Key? key, required this.shipment}) : super(key: key);
|
||||
final dateFormatter = DateFormat('dd MMM yyyy');
|
||||
FcsShipmentListRow({super.key, required this.shipment});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -23,31 +23,31 @@ class FcsShipmentListRow extends StatelessWidget {
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 13),
|
||||
child: new Row(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
Ionicons.ios_airplane,
|
||||
color: primaryColor,
|
||||
size: 30,
|
||||
),
|
||||
new Expanded(
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: new Column(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
Text(
|
||||
shipment.shipmentNumber ?? '',
|
||||
style: new TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: new Text(
|
||||
child: Text(
|
||||
dateFormatter.format(shipment.cutoffDate!),
|
||||
style: new TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user