Replace `describeEnum` by nice lookin string

This commit is contained in:
krawieck 2020-09-29 00:34:35 +02:00
parent b9337a43ae
commit ececfaf93e
1 changed files with 2 additions and 4 deletions

View File

@ -31,9 +31,7 @@ class PostListOptions extends HookWidget {
RadioListTile<SortType>( RadioListTile<SortType>(
value: x, value: x,
groupValue: sort.value, groupValue: sort.value,
// TODO: use something more robust and user-friendly title: Text(x.value),
// than describeEnum
title: Text(describeEnum(x)),
onChanged: (val) { onChanged: (val) {
sort.value = val; sort.value = val;
onChange(val); onChange(val);
@ -57,7 +55,7 @@ class PostListOptions extends HookWidget {
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Text(describeEnum(sort.value)), Text(sort.value.value),
const SizedBox(width: 8), const SizedBox(width: 8),
Icon(Icons.arrow_drop_down), Icon(Icons.arrow_drop_down),
], ],