Simplify grid appendix location
clragon opened this issue · comments
clragon commented
Instead of offering three different options, which I assume are often set to the exact same value like this:
this.showNewPageProgressIndicatorAsGridChild = true,
this.showNewPageErrorIndicatorAsGridChild = true,
this.showNoMoreItemsIndicatorAsGridChild = true,
We could specify an Object as config:
@immutable
class GridAppendixLocation {
static const GridAppendixLocation.asGridChild = GridAppendixLocation({
showNewPageProgressIndicatorAsGridChild: true,
showNewPageErrorIndicatorAsGridChild: true,
showNoMoreItemsIndicatorAsGridChild: true,
});
static const GridAppendixLocation.afterItems = GridAppendixLocation({
showNewPageProgressIndicatorAsGridChild: false,
showNewPageErrorIndicatorAsGridChild: false,
showNoMoreItemsIndicatorAsGridChild: false,
});
const GridAppendixLocation({
required this.showNewPageProgressIndicatorAsGridChild,
required this.showNewPageErrorIndicatorAsGridChild,
required this.showNoMoreItemsIndicatorAsGridChild,
});
final showNewPageProgressIndicatorAsGridChild;
final showNewPageErrorIndicatorAsGridChild;
final showNoMoreItemsIndicatorAsGridChild;
}
this would allow us to write something like
PagedGrid(
appendixLocation: GridAppendixLocation.asGridChild,
)
or
PagedGrid(
appendixLocation: GridAppendixLocation.afterItems,
)
which is shorter and more concise but does not miss out on configurability.
It would also allow us to unify these parameters accross all Grids.
This would be a breaking change.
clragon commented
shelving this idea for now.