INNER CODE UNIT · Dart

isSeparator

Dimibe/grouped_list · lib/grouped_list.dart:314

    var isSeparator = widget.reverse ? (int i) => i.isOdd : (int i) => i.isEven;
    isValidIndex(int i) => i >= 0 && i < _sortedElements.length;

    _ambiguate(WidgetsBinding.instance)!.addPostFrameCallback((_) {
      _scrollListener();
    });

    /// The itemBuilder function for this package divides the [index] by two
    /// because between each element a separator is displayed. Depending on the
    /// direction of the list and if the [index] is even or odd either a item or
    /// the separator widget is displayed.
    ///
    /// If the [index] points to an separator and the previous and next items
    /// are in different groups, a group header widget is displayed.
    Widget itemBuilder(context, index) {
      if (widget.footer != null && index == _sortedElements.length * 2) {
        return widget.footer!;
      }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…