divide method

List<Widget> divide(
  1. Widget t, {
  2. bool filterFn(
    1. int
    )?,
})

Implementation

List<Widget> divide(Widget t, {bool Function(int)? filterFn}) => isEmpty
    ? []
    : (enumerate
        .map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t])
        .expand((i) => i)
        .toList()
      ..removeLast());