update carton and cargo type

This commit is contained in:
tzw
2025-03-12 17:49:27 +06:30
parent 05e912ea68
commit e208734dfa
32 changed files with 1141 additions and 462 deletions

View File

@@ -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();
}),
);
}
}