diff --git a/lib/src/screens/contact/contact_list_page.dart b/lib/src/screens/contact/contact_list_page.dart index 602e235a9..122ba2eb5 100644 --- a/lib/src/screens/contact/contact_list_page.dart +++ b/lib/src/screens/contact/contact_list_page.dart @@ -54,50 +54,49 @@ class ContactListPage extends BasePage { @override Widget body(BuildContext context) { - return Container( - padding: EdgeInsets.only(top: 20.0, bottom: 20.0), - child: Observer( - builder: (_) { + padding: EdgeInsets.all(24), + child: Observer(builder: (_) { final contacts = contactListViewModel.contactsToShow; final walletContacts = contactListViewModel.walletContactsToShow; return CollapsibleSectionList( - sectionCount: 2, - themeColor: Theme.of(context).primaryTextTheme!.titleLarge!.color!, - dividerThemeColor: - Theme.of(context).primaryTextTheme!.bodySmall!.decorationColor!, - sectionTitleBuilder: (int sectionIndex) { - var title = S.current.contact_list_contacts; + sectionCount: 2, + sectionTitleBuilder: (int sectionIndex) { + var title = S.current.contact_list_contacts; - if (sectionIndex == 0) { - title = S.current.contact_list_wallets; - } + if (sectionIndex == 0) { + title = S.current.contact_list_wallets; + } - return Container( - padding: EdgeInsets.only(bottom: 10), - child: Text(title, style: TextStyle(fontSize: 36))); - }, - itemCounter: (int sectionIndex) => sectionIndex == 0 - ? walletContacts.length - : contacts.length, - itemBuilder: (sectionIndex, index) { - if (sectionIndex == 0) { - final walletInfo = walletContacts[index]; - return generateRaw(context, walletInfo); - } + return Container( + padding: EdgeInsets.only(bottom: 10), + child: Text(title, style: TextStyle( + color: Theme.of(context) + .primaryTextTheme + .titleLarge! + .color!, + fontSize: 36))); + }, + itemCounter: (int sectionIndex) => + sectionIndex == 0 ? walletContacts.length : contacts.length, + itemBuilder: (sectionIndex, index) { + if (sectionIndex == 0) { + final walletInfo = walletContacts[index]; + return generateRaw(context, walletInfo); + } - final contact = contacts[index]; - final content = generateRaw(context, contact); - return contactListViewModel.isEditable - ? Slidable( - key: Key('${contact.key}'), - endActionPane: _actionPane(context, contact), - child: content, - ) - : content; - }, - );}) - ); + final contact = contacts[index]; + final content = generateRaw(context, contact); + return contactListViewModel.isEditable + ? Slidable( + key: Key('${contact.key}'), + endActionPane: _actionPane(context, contact), + child: content, + ) + : content; + }, + ); + })); } Widget generateRaw(BuildContext context, ContactBase contact) { diff --git a/lib/src/widgets/collapsible_standart_list.dart b/lib/src/widgets/collapsible_standart_list.dart index 9a6d1096a..83e4daee2 100644 --- a/lib/src/widgets/collapsible_standart_list.dart +++ b/lib/src/widgets/collapsible_standart_list.dart @@ -6,8 +6,6 @@ class CollapsibleSectionList extends SectionStandardList { {required int sectionCount, required int Function(int sectionIndex) itemCounter, required Widget Function(int sectionIndex, int itemIndex) itemBuilder, - Color? themeColor, - Color? dividerThemeColor, Widget Function(int sectionIndex)? sectionTitleBuilder, bool hasTopSeparator = false}) : super( @@ -15,9 +13,7 @@ class CollapsibleSectionList extends SectionStandardList { sectionCount: sectionCount, itemCounter: itemCounter, itemBuilder: itemBuilder, - sectionTitleBuilder: sectionTitleBuilder, - themeColor: themeColor, - dividerThemeColor: dividerThemeColor); + sectionTitleBuilder: sectionTitleBuilder); @override Widget buildTitle(List items, int sectionIndex) { diff --git a/lib/src/widgets/standard_list.dart b/lib/src/widgets/standard_list.dart index 2b6e05e04..9abef70b1 100644 --- a/lib/src/widgets/standard_list.dart +++ b/lib/src/widgets/standard_list.dart @@ -18,7 +18,7 @@ class StandardListRow extends StatelessWidget { return InkWell( onTap: () => onTap?.call(context), child: Container( - color: _backgroundColor(context), + color: Theme.of(context).colorScheme.background, height: 56, padding: EdgeInsets.only(left: 24, right: 24), child: Row( @@ -54,11 +54,7 @@ class StandardListRow extends StatelessWidget { Color titleColor(BuildContext context) => isSelected ? Palette.blueCraiola - : Theme.of(context).primaryTextTheme!.titleLarge!.color!; - - Color _backgroundColor(BuildContext context) { - return Theme.of(context).colorScheme.background; - } + : Theme.of(context).primaryTextTheme.titleLarge!.color!; } class SectionHeaderListRow extends StatelessWidget { @@ -123,8 +119,6 @@ class SectionStandardList extends StatelessWidget { required this.itemBuilder, required this.sectionCount, this.dividerPadding = const EdgeInsets.only(left: 24), - this.themeColor, - this.dividerThemeColor, this.sectionTitleBuilder, this.hasTopSeparator = false, }) : totalRows = []; @@ -135,8 +129,6 @@ class SectionStandardList extends StatelessWidget { final Widget Function(int sectionIndex, int itemIndex) itemBuilder; final Widget Function(int sectionIndex)? sectionTitleBuilder; final List totalRows; - final Color? themeColor; - final Color? dividerThemeColor; final EdgeInsets dividerPadding; List transform( @@ -144,9 +136,7 @@ class SectionStandardList extends StatelessWidget { int sectionCount, int Function(int sectionIndex) itemCounter, Widget Function(int sectionIndex, int itemIndex) itemBuilder, - Widget Function(int sectionIndex)? sectionTitleBuilder, - Color? themeColor, - Color? dividerThemeColor) { + Widget Function(int sectionIndex)? sectionTitleBuilder) { final items = []; for (var sectionIndex = 0; sectionIndex < sectionCount; sectionIndex++) { @@ -193,7 +183,7 @@ class SectionStandardList extends StatelessWidget { @override Widget build(BuildContext context) { totalRows.addAll(transform(hasTopSeparator, sectionCount, itemCounter, - itemBuilder, sectionTitleBuilder, themeColor, dividerThemeColor)); + itemBuilder, sectionTitleBuilder)); return ListView.separated( separatorBuilder: (_, index) {