mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
Cw 514 add sort functionality for addressbook mywallets and contacts (#1309)
* add sort function to contact list * fix UI * prevent duplicate contact names * dispose contact source subscription * fix custom order issue * update the address book UI * fix saving custom order * fix merge conflict issue * review fixes [skip ci] * revert to single scroll for entire page * tabBarView address book --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
import 'package:cake_wallet/src/widgets/standard_list.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CollapsibleSectionList extends SectionStandardList {
|
||||
CollapsibleSectionList(
|
||||
{required int sectionCount,
|
||||
required int Function(int sectionIndex) itemCounter,
|
||||
required Widget Function(int sectionIndex, int itemIndex) itemBuilder,
|
||||
Widget Function(int sectionIndex)? sectionTitleBuilder,
|
||||
bool hasTopSeparator = false})
|
||||
: super(
|
||||
hasTopSeparator: hasTopSeparator,
|
||||
sectionCount: sectionCount,
|
||||
itemCounter: itemCounter,
|
||||
itemBuilder: itemBuilder,
|
||||
sectionTitleBuilder: sectionTitleBuilder);
|
||||
|
||||
@override
|
||||
Widget buildTitle(List<Widget> items, int sectionIndex) {
|
||||
if (sectionTitleBuilder == null) {
|
||||
throw Exception('Cannot to build title. sectionTitleBuilder is null');
|
||||
}
|
||||
return sectionTitleBuilder!.call(sectionIndex);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Widget> buildSection(int itemCount, List<Widget> items, int sectionIndex) {
|
||||
final List<Widget> section = [];
|
||||
|
||||
for (var itemIndex = 0; itemIndex < itemCount; itemIndex++) {
|
||||
final item = itemBuilder(sectionIndex, itemIndex);
|
||||
|
||||
section.add(StandardListSeparator());
|
||||
|
||||
section.add(item);
|
||||
}
|
||||
return section;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user