SortConfig constructor

SortConfig({
  1. required void onSort(
    1. bool asc
    ),
  2. Icon ascIcon = const Icon(Icons.arrow_drop_up),
  3. Icon desIcon = const Icon(Icons.arrow_drop_down),
})

Implementation

SortConfig({
  required this.onSort,
  this.ascIcon = const Icon(Icons.arrow_drop_up),
  this.desIcon = const Icon(Icons.arrow_drop_down),
}) : sortSubject = BehaviorSubject<bool?>.seeded(null) {
  sortSubject.skip(1).where((event) => event != null).map((e) => e!).listen((value) => onSort(value));
}