Update navigation
This commit is contained in:
parent
25fd819d03
commit
37fd2de91c
|
|
@ -697,39 +697,52 @@ class _EntityFilter extends StatelessWidget {
|
|||
children: filterEntity == null
|
||||
? []
|
||||
: [
|
||||
SizedBox(width: 4),
|
||||
FlatButton(
|
||||
child: Text(
|
||||
'${localization.lookup(filterEntityType.plural)} › ${filterEntity.listDisplayName}',
|
||||
'${localization.lookup('$filterEntityType')} › ${filterEntity.listDisplayName}',
|
||||
style: TextStyle(fontSize: 17),
|
||||
),
|
||||
onPressed: () => viewEntitiesByType(
|
||||
context: context, entityType: filterEntityType),
|
||||
),
|
||||
Spacer(),
|
||||
DropdownButtonHideUnderline(
|
||||
child: DropdownButton<EntityType>(
|
||||
value: routeEntityType,
|
||||
onChanged: (value) {
|
||||
print('## SELCTED: $value');
|
||||
},
|
||||
items: [
|
||||
filterEntityType,
|
||||
...filterEntityType.relatedTypes
|
||||
]
|
||||
.where((element) =>
|
||||
state.company.isModuleEnabled(element))
|
||||
.map((type) => DropdownMenuItem<EntityType>(
|
||||
value: type,
|
||||
PopupMenuButton<EntityType>(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
routeEntityType == filterEntityType
|
||||
? localization.overview
|
||||
: '${localization.lookup(routeEntityType.plural)}',
|
||||
style: TextStyle(fontSize: 17),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Icon(Icons.arrow_drop_down),
|
||||
],
|
||||
),
|
||||
initialValue: routeEntityType,
|
||||
onSelected: (EntityType value) =>
|
||||
viewEntitiesByType(context: context, entityType: value),
|
||||
itemBuilder: (BuildContext context) => [
|
||||
filterEntityType,
|
||||
...filterEntityType.relatedTypes
|
||||
]
|
||||
.where(
|
||||
(element) => state.company.isModuleEnabled(element))
|
||||
.map((type) => PopupMenuItem<EntityType>(
|
||||
value: type,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 75,
|
||||
),
|
||||
child: Text(type == filterEntityType
|
||||
? localization.overview
|
||||
: '${localization.lookup(type.plural)}'),
|
||||
onTap: () {
|
||||
print('## TAPPED: $type');
|
||||
},
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
IconButton(
|
||||
icon: Icon(Icons.clear),
|
||||
onPressed: () => store.dispatch(ClearEntityFilter()),
|
||||
|
|
|
|||
Loading…
Reference in New Issue