checkPreconditions method

dynamic checkPreconditions()

Implementation

checkPreconditions() {
  assert(!multipleSelection || doneButton != null);
  assert(menuConstraints == null || !dialogBox);
  assert(itemsPerPage == null || currentPage != null,
      "currentPage must be given if itemsPerPage is given");
  assert(
      dropDownDialogPadding == null || buildDropDownDialog == null,
      "buildDropDownDialog and dropDownDialogPadding cannot be set at" +
          " the same time");
  assert(dialogBox || dropDownDialogPadding == null,
      "dropDownDialogPadding must be null if dialogBox == false");
  assert(
      futureSearchOrderOptions == null || futureSearchFn != null,
      "futureSearchOrderOptions is of no use if futureSearchFn is not " +
          "set");
  assert(
      futureSearchFilterOptions == null || futureSearchFn != null,
      "futureSearchFilterOptions is of no use if futureSearchFn is not " +
          "set");
  assert(futureSearchFn == null || searchFn == null,
      "futureSearchFn and searchFn cannot work together");
  assert((futureSearchFn == null) != (items == null),
      "must either have futureSearchFn or items but not both");
  assert(
      futureSearchFn == null ||
          (multipleSelection
              ? (futureSelectedValues != null && value == null)
              : (true && futureSelectedValues == null)),
      "${multipleSelection ? "futureSelectedValues" : "value"} must be " +
          "set if futureSearchFn is set in " +
          "${multipleSelection ? "multiple" : "single"} selection mode " +
          "while " +
          "${multipleSelection ? "value" : "futureSelectedValues"} " +
          "must not be set");
  assert(fieldDecoration == null || underline == null,
      "use either underline or fieldDecoration");
  assert(fieldPresentationFn == null || underline == null,
      "use either underline or fieldPresentationFn");
  assert(fieldDecoration == null || padding == null,
      "use either padding or fieldDecoration");
  assert(fieldPresentationFn == null || padding == null,
      "use either padding or fieldPresentationFn");
  assert(dialogBox || showDialogFn == null,
      "use showDialogFn only with dialogBox");
}