Fix entity actions on edit scaffold

This commit is contained in:
Hillel Coren 2023-11-29 15:18:22 +02:00
parent c98d08f3f7
commit 3eac18929b
1 changed files with 20 additions and 22 deletions

View File

@ -433,30 +433,28 @@ class EditScaffold extends StatelessWidget {
//size: iconSize, //size: iconSize,
//color: color, //color: color,
), ),
itemBuilder: (BuildContext context) => itemBuilder: (BuildContext context) => [
<PopupMenuEntry<EntityAction>>[
...actions! ...actions!
.map((action) => action == null .map((action) => action == null
? PopupMenuDivider() ? PopupMenuDivider()
: PopupMenuItem<EntityAction>( : PopupMenuItem<EntityAction>(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Icon( Icon(
getEntityActionIcon(action), getEntityActionIcon(action),
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.secondary, .secondary,
),
SizedBox(width: 16.0),
Text(AppLocalization.of(
context)!
.lookup(action.toString())),
],
), ),
value: action, SizedBox(width: 16.0),
)) Text(AppLocalization.of(context)!
.toList() .lookup(action.toString())),
as Iterable<PopupMenuEntry<EntityAction>> ],
),
value: action,
))
.whereType<PopupMenuEntry<EntityAction>>()
.toList()
], ],
onSelected: (action) => onSelected: (action) =>
onActionPressed!(context, action), onActionPressed!(context, action),