Make timeago in new settings list line wrap
This commit is contained in:
parent
92a1cfef2b
commit
3bb348000f
|
|
@ -122,11 +122,15 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
|||
].contains(history.entityType)) {
|
||||
title = Text(localization.lookup(history.entityType.toString()));
|
||||
if (history.entityType == EntityType.reports) {
|
||||
subtitle =
|
||||
Text(localization.lookup(state.uiState.reportsUIState.report));
|
||||
subtitle = Text(
|
||||
localization.lookup(state.uiState.reportsUIState.report),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
);
|
||||
} else if (history.entityType == EntityType.settings) {
|
||||
subtitle =
|
||||
Text(localization.lookup(history.id ?? kSettingsCompanyDetails));
|
||||
subtitle = Text(
|
||||
localization.lookup(history.id ?? kSettingsCompanyDetails),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
entity = state.getEntityMap(history.entityType)[history.id] as BaseEntity;
|
||||
|
|
@ -158,7 +162,7 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
|||
key: ValueKey('__${history.id}_${history.entityType}__'),
|
||||
leading: Icon(getEntityIcon(history.entityType)),
|
||||
title: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
|
|
@ -168,6 +172,7 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
|||
subtitle,
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: LiveText(
|
||||
() => timeago.format(history.dateTime,
|
||||
|
|
|
|||
|
|
@ -697,17 +697,34 @@ class SettingsSearch extends StatelessWidget {
|
|||
.toLowerCase()
|
||||
.contains(filter.toLowerCase()))
|
||||
ListTile(
|
||||
title: Text(localization.lookup(parts[1])),
|
||||
title: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(localization.lookup(parts[1])),
|
||||
Text(
|
||||
localization.lookup(parts[2]),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
if (parts[0].isNotEmpty)
|
||||
Flexible(
|
||||
child: Text(timeago.format(DateTime.parse(parts[0]),
|
||||
locale:
|
||||
localeSelector(store.state, twoLetter: true) +
|
||||
'_short'))),
|
||||
],
|
||||
),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(left: 6, top: 10),
|
||||
child: Icon(getSettingIcon(parts[2]), size: 22),
|
||||
),
|
||||
trailing: parts[0].isEmpty
|
||||
? null
|
||||
: Text(timeago.format(DateTime.parse(parts[0]),
|
||||
locale: localeSelector(store.state, twoLetter: true) +
|
||||
'_short')),
|
||||
subtitle: Text(localization.lookup(parts[2])),
|
||||
onTap: () =>
|
||||
viewModel.loadSection(context, parts[2], parseInt(parts[3])),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue