SelectModel constructor

SelectModel(
  1. String title,
  2. String id,
  3. List<Line> lines,
  4. DataSource dataSource,
  5. TypeSelect typeSelect, {
  6. List<FilterBase>? filters,
  7. List<ActionSelect>? actions,
  8. List<ActionSelectBase>? buttons,
  9. List<int>? selectedItens,
  10. bool showPreSelected = false,
  11. DataSource? alternativeDataSource,
  12. bool? openSearchAutomatically,
  13. List<ItemSelect>? preSelected,
  14. bool confirmToLoadData = false,
  15. bool? allowSelectAll,
  16. bool showFiltersInput = true,
  17. SelectModelTheme theme = const SelectModelTheme(tableTheme: SelectModelThemeTable()),
  18. CustomBottomBuilder? tableBottomBuilder,
  19. CustomBottomBuilder? tableTopLeftBuilder,
  20. Future<Line?> initialFilter(
    1. List<Line>
    )?,
  21. CustomBottomBuilder? listBottomBuilder,
  22. bool? showInCards,
  23. Widget filterTopBuilder(
    1. BuildContext
    )?,
  24. 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;
  }
}