Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
CTalvio committed Jul 20, 2023
1 parent bfc245e commit 1424823
Show file tree
Hide file tree
Showing 13 changed files with 645 additions and 555 deletions.
2 changes: 1 addition & 1 deletion lib/community/pages/community_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _CommunityPageState extends State<CommunityPage> with AutomaticKeepAliveCl
create: (context) => currentCommunityBloc = CommunityBloc(),
child: BlocConsumer<CommunityBloc, CommunityState>(
listenWhen: (previousState, currentState) {
if (previousState.subscribedType != currentState.subscribedType ) {
if (previousState.subscribedType != currentState.subscribedType) {
context.read<account_bloc.AccountBloc>().add(account_bloc.GetAccountInformation());
}

Expand Down
18 changes: 10 additions & 8 deletions lib/community/widgets/community_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,16 @@ class _CommunityDrawerState extends State<CommunityDrawer> {
backgroundColor: community.icon != null ? Colors.transparent : theme.colorScheme.secondaryContainer,
foregroundImage: community.icon != null ? CachedNetworkImageProvider(community.icon!) : null,
maxRadius: 16,
child: community.icon == null ? Text(
community.name[0].toUpperCase(),
semanticsLabel: '',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
) : null,
child: community.icon == null
? Text(
community.name[0].toUpperCase(),
semanticsLabel: '',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
)
: null,
),
const SizedBox(width: 16.0),
Expanded(
Expand Down
52 changes: 11 additions & 41 deletions lib/community/widgets/community_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ class CommunityHeader extends StatelessWidget {
child: Container(
decoration: communityInfo?.communityView.community.banner != null
? BoxDecoration(
image: DecorationImage(
image: CachedNetworkImageProvider(
communityInfo!.communityView.community.banner!),
fit: BoxFit.cover),
image: DecorationImage(image: CachedNetworkImageProvider(communityInfo!.communityView.community.banner!), fit: BoxFit.cover),
)
: null,
child: Container(
Expand All @@ -53,26 +50,16 @@ class CommunityHeader extends StatelessWidget {
)
: null,
child: Padding(
padding: const EdgeInsets.only(
top: 16.0, left: 24.0, right: 24.0, bottom: 16.0),
padding: const EdgeInsets.only(top: 16.0, left: 24.0, right: 24.0, bottom: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
CircleAvatar(
backgroundColor:
communityInfo?.communityView.community.icon !=
null
? Colors.transparent
: theme.colorScheme.onBackground,
foregroundImage: communityInfo
?.communityView.community.icon !=
null
? CachedNetworkImageProvider(
communityInfo!.communityView.community.icon!)
: null,
backgroundColor: communityInfo?.communityView.community.icon != null ? Colors.transparent : theme.colorScheme.onBackground,
foregroundImage: communityInfo?.communityView.community.icon != null ? CachedNetworkImageProvider(communityInfo!.communityView.community.icon!) : null,
maxRadius: 45,
),
const SizedBox(width: 20.0),
Expand All @@ -82,48 +69,31 @@ class CommunityHeader extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
communityInfo?.communityView.community.title ??
communityInfo
?.communityView.community.name ??
'N/A',
style: theme.textTheme.headlineSmall
?.copyWith(fontWeight: FontWeight.w600),
communityInfo?.communityView.community.title ?? communityInfo?.communityView.community.name ?? 'N/A',
style: theme.textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.w600),
),
Text('${communityInfo?.communityView.community.name ?? 'N/A'}@${fetchInstanceNameFromUrl(communityInfo?.communityView.community.actorId) ?? 'N/A'}'),
const SizedBox(height: 8.0),
Row(
children: [
IconText(
icon: const Icon(Icons.people_rounded),
text: formatNumberToK(communityInfo
?.communityView
.counts
.subscribers ??
0),
text: formatNumberToK(communityInfo?.communityView.counts.subscribers ?? 0),
),
const SizedBox(width: 8.0),
IconText(
icon: const Icon(
Icons.calendar_month_rounded),
text: formatNumberToK(communityInfo
?.communityView
.counts
.usersActiveMonth ??
0),
icon: const Icon(Icons.calendar_month_rounded),
text: formatNumberToK(communityInfo?.communityView.counts.usersActiveMonth ?? 0),
),
],
),
],
),
),
Icon(
isSidebarOpen != null && isSidebarOpen!
? Icons.chevron_right_rounded
: Icons.chevron_left_rounded,
isSidebarOpen != null && isSidebarOpen! ? Icons.chevron_right_rounded : Icons.chevron_left_rounded,
size: 50,
shadows: const <Shadow>[
Shadow(color: Colors.black, blurRadius: 5.0)
],
shadows: const <Shadow>[Shadow(color: Colors.black, blurRadius: 5.0)],
)
],
),
Expand Down
Loading

0 comments on commit 1424823

Please sign in to comment.