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