// Flutter imports: import 'package:flutter/material.dart'; // Project imports: import 'num_ext.dart'; extension WidgetListExt on List { List sepWidget({Widget separate}) { return List.generate(this.length * 2 - 1, (index) { if (index.isEven) return this[index ~/ 2]; else return separate ?? 10.wb; }); } } extension OddListExt on List { List oddList() { List _newList = []; this.forEach((element) { if (this.indexOf(element).isEven) { _newList.add(element); } }); return _newList; } } extension EvenListExt on List { List evenList() { List _newList = []; this.forEach((element) { if (this.indexOf(element).isOdd) { _newList.add(element); } }); return _newList; } }