|
|
|
@ -17,14 +17,21 @@ class SortBoxBuilder<T extends Enum, R> extends StatelessWidget {
|
|
|
|
|
final Widget Function(BuildContext, List<R>?) builder; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(final BuildContext context) => OptionBuilder<T>( |
|
|
|
|
Widget build(final BuildContext context) { |
|
|
|
|
if (input == null || (input?.isEmpty ?? false)) { |
|
|
|
|
return builder(context, null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return OptionBuilder<T>( |
|
|
|
|
option: sortPropertyOption, |
|
|
|
|
builder: (final context, final property) => OptionBuilder<SortBoxOrder>( |
|
|
|
|
option: sortBoxOrderOption, |
|
|
|
|
builder: (final context, final order) => builder( |
|
|
|
|
context, |
|
|
|
|
input == null ? null : sortBox.sort(input!, Box(property, order)), |
|
|
|
|
), |
|
|
|
|
builder: (final context, final order) { |
|
|
|
|
final box = Box(property, order); |
|
|
|
|
|
|
|
|
|
return builder(context, sortBox.sort(input!, box)); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|