Closed clragon closed 4 months ago
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.
shelving this idea for now.
Instead of offering three different options, which I assume are often set to the exact same value like this:
We could specify an Object as config:
this would allow us to write something like
or
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.