null safety
This commit is contained in:
@@ -78,7 +78,7 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
widget.buttonIcon ?? Icons.filter_list,
|
||||
color: widget.buttonColor ?? primaryColor,
|
||||
color: widget.buttonColor,
|
||||
),
|
||||
hightlight
|
||||
? Positioned(
|
||||
@@ -98,14 +98,12 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
)),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return popmenus.map((LocalPopupMenu choice) {
|
||||
if (choice == null) return null;
|
||||
return PopupMenuItem<LocalPopupMenu>(
|
||||
value: choice,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
LocalText(context, choice.textKey,
|
||||
color:
|
||||
choice?.enabled ?? true ? primaryColor : Colors.grey),
|
||||
LocalText(context, choice.textKey ?? "",
|
||||
color: choice.enabled ? primaryColor : Colors.grey),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
@@ -124,8 +122,8 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
|
||||
bool _needHighlight() {
|
||||
popmenus.forEach((e) {
|
||||
if (e == null) return false;
|
||||
if (e.selected && e.highlight) return true;
|
||||
if (e == null) return;
|
||||
if (e.selected && e.highlight) return;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user