-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
127 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,21 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_mobx/flutter_mobx.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import 'package:encointer_wallet/config/consts.dart'; | ||
import 'package:encointer_wallet/theme/theme.dart'; | ||
import 'package:encointer_wallet/store/app.dart'; | ||
|
||
class CommunityIconObserver extends StatelessWidget { | ||
const CommunityIconObserver({super.key, double? radius}) : radius = radius ?? 10; | ||
class CommunityCircleAvatar extends StatelessWidget { | ||
const CommunityCircleAvatar(this.icon, {super.key, double? radius}) : radius = radius ?? 10; | ||
|
||
final SvgPicture icon; | ||
|
||
final double radius; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final store = context.watch<AppStore>(); | ||
return CircleAvatar( | ||
backgroundColor: context.colorScheme.background, | ||
radius: radius, | ||
child: Observer( | ||
builder: (_) { | ||
if (store.encointer.community != null && store.encointer.community!.assetsCid != null) { | ||
if (store.encointer.community!.communityIcon != null) { | ||
return SvgPicture.string(store.encointer.community!.communityIcon!); | ||
} else { | ||
return SvgPicture.asset(fallBackCommunityIcon); | ||
} | ||
} else { | ||
return SvgPicture.asset(fallBackCommunityIcon); | ||
} | ||
}, | ||
), | ||
child: icon, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.