diff --git a/app/lib/common/components/logo/community_icon.dart b/app/lib/common/components/logo/community_icon.dart index 377d6652c..b6f670658 100644 --- a/app/lib/common/components/logo/community_icon.dart +++ b/app/lib/common/components/logo/community_icon.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_svg/svg.dart'; @@ -28,8 +27,7 @@ class CommunityIconObserver extends StatelessWidget { return SvgPicture.asset(fallBackCommunityIcon); } } else { - ///TODO(Azamat): Add some image saying community not selected - return const CupertinoActivityIndicator(); + return SvgPicture.asset(fallBackCommunityIcon); } }, ), diff --git a/app/lib/page/assets/index.dart b/app/lib/page/assets/index.dart index e3a3bb43c..ee584dde8 100644 --- a/app/lib/page/assets/index.dart +++ b/app/lib/page/assets/index.dart @@ -14,7 +14,6 @@ import 'package:upgrader/upgrader.dart'; import 'package:collection/collection.dart'; import 'package:encointer_wallet/l10n/l10.dart'; -import 'package:encointer_wallet/common/components/loading/centered_activity_indicator.dart'; import 'package:encointer_wallet/page/assets/announcement/view/announcement_view.dart'; import 'package:encointer_wallet/common/components/address_icon.dart'; import 'package:encointer_wallet/gen/assets.gen.dart'; @@ -351,29 +350,11 @@ class _AssetsViewState extends State { List _allCommunities() { final communityStores = context.read().encointer.communityStores?.values.toList(); - if (communityStores != null && communityStores.isNotEmpty) { - return communityStores - .mapIndexed( - (i, e) => AccountOrCommunityData( - avatar: Container( - height: avatarSize, - width: avatarSize, - decoration: BoxDecoration( - color: context.colorScheme.background, - shape: BoxShape.circle, - ), - child: e.communityIcon != null - ? SvgPicture.string(e.communityIcon!) - : SvgPicture.asset(fallBackCommunityIcon), - ), - name: e.name, - isSelected: widget.store.encointer.community?.cid == e.cid, - ), - ) - .toList(); - } else { - return [ - AccountOrCommunityData( + + if (communityStores == null) return []; + return communityStores + .mapIndexed( + (i, e) => AccountOrCommunityData( avatar: Container( height: avatarSize, width: avatarSize, @@ -381,11 +362,15 @@ class _AssetsViewState extends State { color: context.colorScheme.background, shape: BoxShape.circle, ), - child: const CenteredActivityIndicator(), + child: e.communityIcon != null + ? SvgPicture.string(e.communityIcon!) + : SvgPicture.asset(fallBackCommunityIcon), ), - name: '...') - ]; - } + name: e.name, + isSelected: widget.store.encointer.community?.cid == e.cid, + ), + ) + .toList(); } List initAllAccounts() { diff --git a/app/test_driver/app/home/home_test.dart b/app/test_driver/app/home/home_test.dart index ff32e2e9c..2c1f4ba51 100644 --- a/app/test_driver/app/home/home_test.dart +++ b/app/test_driver/app/home/home_test.dart @@ -10,7 +10,6 @@ Future homeInit(FlutterDriver driver) async { } Future changeCommunity(FlutterDriver driver) async { - await driver.runUnsynchronized(() async { await driver.tap(find.byValueKey(EWTestKeys.panelController)); await driver.tap(find.byValueKey(EWTestKeys.addCommunity)); @@ -21,7 +20,6 @@ Future changeCommunity(FlutterDriver driver) async { await Future.delayed(const Duration(milliseconds: 1000)); await closePanel(driver); await refreshWalletPage(driver); - }); } Future registerAndWait(FlutterDriver driver, ParticipantTypeTestHelper registrationType) async {