Update navigation

This commit is contained in:
Hillel Coren 2020-05-22 17:50:16 +03:00
parent 5e2c3cc425
commit 6158db59cc
1 changed files with 18 additions and 11 deletions

View File

@ -702,15 +702,22 @@ class _EntityFilter extends StatelessWidget {
? [] ? []
: [ : [
SizedBox(width: 4), SizedBox(width: 4),
FlatButton( Expanded(
child: Text( child: Align(
'${localization.lookup('$filterEntityType')} ${filterEntity.listDisplayName}', alignment: Alignment.centerLeft,
style: TextStyle(fontSize: 17), child: FlatButton(
child: Text(
'${localization.lookup('$filterEntityType')} ${filterEntity.listDisplayName}',
style: TextStyle(fontSize: 17),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start,
maxLines: 1,
),
onPressed: () => viewEntitiesByType(
context: context, entityType: filterEntityType),
),
), ),
onPressed: () => viewEntitiesByType(
context: context, entityType: filterEntityType),
), ),
Spacer(),
PopupMenuButton<EntityType>( PopupMenuButton<EntityType>(
child: Row( child: Row(
children: [ children: [
@ -725,14 +732,14 @@ class _EntityFilter extends StatelessWidget {
], ],
), ),
initialValue: routeEntityType, initialValue: routeEntityType,
onSelected: (EntityType value) => onSelected: (EntityType value) => viewEntitiesByType(
viewEntitiesByType(context: context, entityType: value), context: context, entityType: value),
itemBuilder: (BuildContext context) => [ itemBuilder: (BuildContext context) => [
filterEntityType, filterEntityType,
...filterEntityType.relatedTypes ...filterEntityType.relatedTypes
] ]
.where( .where((element) =>
(element) => state.company.isModuleEnabled(element)) state.company.isModuleEnabled(element))
.map((type) => PopupMenuItem<EntityType>( .map((type) => PopupMenuItem<EntityType>(
value: type, value: type,
child: ConstrainedBox( child: ConstrainedBox(