SelectModel constructor
SelectModel(
- String title,
- String id,
- List<
Line> lines, - DataSource dataSource,
- TypeSelect typeSelect, {
- List<
FilterBase> ? filters, - List<
ActionSelect> ? actions, - List<
ActionSelectBase> ? buttons, - List<
int> ? selectedItens, - bool showPreSelected = false,
- DataSource? alternativeDataSource,
- bool? openSearchAutomatically,
- List<
ItemSelect> ? preSelected, - bool confirmToLoadData = false,
- bool? allowSelectAll,
- bool showFiltersInput = true,
- SelectModelTheme theme = const SelectModelTheme(tableTheme: SelectModelThemeTable()),
- CustomBottomBuilder? tableBottomBuilder,
- CustomBottomBuilder? tableTopLeftBuilder,
- Future<
Line?> initialFilter()?, - CustomBottomBuilder? listBottomBuilder,
- bool? showInCards,
- Widget filterTopBuilder()?,
- bool bottomActionForTypeSelectMULTIPLE = true,
Implementation
SelectModel(this.title, this.id, this.lines, this.dataSource, this.typeSelect,
{this.filters,
this.actions,
this.buttons,
this.selectedItens,
this.showPreSelected = false,
this.alternativeDataSource,
this.openSearchAutomatically,
this.preSelected,
this.confirmToLoadData = false,
this.allowSelectAll,
this.showFiltersInput = true,
this.theme = const SelectModelTheme(tableTheme: SelectModelThemeTable()),
this.tableBottomBuilder,
this.tableTopLeftBuilder,
this.initialFilter,
this.listBottomBuilder,
this.showInCards,
this.filterTopBuilder,
this.bottomActionForTypeSelectMULTIPLE = true}) {
if (openSearchAutomatically == null) {
openSearchAutomatically = !UtilsPlatform.isMobile;
}
if (buttons != null &&
buttons!.where((element) => element is ActionSelect).length > 1) {
int i = 0;
while (i < buttons!.length) {
if ((i -
buttons!
.sublist(0, i)
.where((element) => !(element is ActionSelect))
.length) >
0 &&
buttons![i] is ActionSelect) {
if ((buttons![i] as ActionSelect).floatingActionButtonMini == null) {
(buttons![i] as ActionSelect).floatingActionButtonMini = true;
}
}
i++;
}
}
if (showInCards == null) {
showInCards = lines.length > 2;
}
}