update carton and cargo type
This commit is contained in:
@@ -15,14 +15,13 @@ class LocalPopupMenuButton extends StatefulWidget {
|
||||
final Color buttonColor;
|
||||
|
||||
const LocalPopupMenuButton(
|
||||
{Key? key,
|
||||
{super.key,
|
||||
this.popupMenuCallback,
|
||||
this.popmenus,
|
||||
this.buttonIcon,
|
||||
this.selectable = true,
|
||||
this.multiSelect = false,
|
||||
this.buttonColor = primaryColor})
|
||||
: super(key: key);
|
||||
this.buttonColor = primaryColor});
|
||||
|
||||
@override
|
||||
_LocalPopupMenuButtonState createState() => _LocalPopupMenuButtonState();
|
||||
@@ -46,30 +45,32 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
if (widget.selectable) {
|
||||
if (!widget.multiSelect) {
|
||||
setState(() {
|
||||
popmenus.forEach((e) {
|
||||
if (e.id != selected.id)
|
||||
for (var e in popmenus) {
|
||||
if (e.id != selected.id) {
|
||||
e.selected = false;
|
||||
else
|
||||
} else {
|
||||
e.selected = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
selected.selected = true;
|
||||
} else {
|
||||
setState(() {
|
||||
popmenus.forEach((e) {
|
||||
for (var e in popmenus) {
|
||||
if (e.id == selected.id) e.selected = !e.selected;
|
||||
});
|
||||
}
|
||||
});
|
||||
selected.selected = !selected.selected;
|
||||
}
|
||||
}
|
||||
if (selected.enabled && widget.popupMenuCallback != null)
|
||||
if (selected.enabled && widget.popupMenuCallback != null) {
|
||||
widget.popupMenuCallback!(selected);
|
||||
}
|
||||
},
|
||||
icon: Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: new BoxDecoration(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
//color: Colors.white,
|
||||
),
|
||||
@@ -87,7 +88,7 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
child: Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: new BoxDecoration(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: secondaryColor,
|
||||
),
|
||||
@@ -109,7 +110,7 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
color:
|
||||
choice.enabled ? Colors.black : Colors.grey))
|
||||
: LocalText(context, choice.textKey ?? "",
|
||||
color: choice.enabled ? Colors.black : Colors.grey,
|
||||
color: choice.enabled ? Colors.black : Colors.grey,
|
||||
fontSize: 14),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
@@ -128,9 +129,9 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
}
|
||||
|
||||
bool _needHighlight() {
|
||||
popmenus.forEach((e) {
|
||||
if (e.selected && e.highlight) return;
|
||||
});
|
||||
for (var e in popmenus) {
|
||||
if (e.selected && e.highlight) continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user