Skip to content

Commit

Permalink
Fix broadcast round loading view alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Feb 24, 2025
1 parent e1ee24c commit a8f002d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
16 changes: 8 additions & 8 deletions lib/src/view/broadcast/broadcast_boards_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ class BroadcastBoardsTab extends ConsumerWidget {
return switch (round) {
AsyncData(:final value) =>
value.games.isEmpty
? Center(
child: ListView(
shrinkWrap: true,
? Padding(
padding: Styles.bodyPadding,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(Icons.info, size: 30),
Text(context.l10n.broadcastNoBoardsYet),
const SizedBox(height: 8.0),
Text(context.l10n.broadcastNoBoardsYet, textAlign: TextAlign.center),
],
),
)
Expand All @@ -65,10 +68,7 @@ class BroadcastBoardsTab extends ConsumerWidget {
roundSlug: value.round.slug,
),
AsyncError(:final error) => Center(
child: ListView(
shrinkWrap: true,
children: [Center(child: Text('Could not load broadcast: $error'))],
),
child: Center(child: Text('Could not load broadcast: $error')),
),
_ => const Center(child: CircularProgressIndicator.adaptive()),
};
Expand Down
14 changes: 2 additions & 12 deletions lib/src/view/broadcast/broadcast_overview_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,9 @@ class BroadcastOverviewTab extends ConsumerWidget {
],
);
case AsyncError(:final error):
return Center(
child: ListView(
shrinkWrap: true,
children: [Center(child: Text('Cannot load broadcast data: $error'))],
),
);
return Center(child: Text('Cannot load broadcast data: $error'));
case _:
return Center(
child: ListView(
shrinkWrap: true,
children: const [Center(child: CircularProgressIndicator.adaptive())],
),
);
return const Center(child: CircularProgressIndicator.adaptive());
}
}
}
Expand Down

0 comments on commit a8f002d

Please sign in to comment.