Skip to content

Commit

Permalink
Merge pull request #901 from tom-anders/fixEmptySpaceInWatch
Browse files Browse the repository at this point in the history
fix: empty space in "Watch" tab in landscape orientation
  • Loading branch information
veloce authored Aug 5, 2024
2 parents 9e3f4de + 0f13e90 commit 36d251b
Showing 1 changed file with 13 additions and 26 deletions.
39 changes: 13 additions & 26 deletions lib/src/view/watch/watch_tab_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ class _WatchScreenState extends ConsumerState<WatchTabScreen> {
);
}

List<Widget> get watchTabWidgets => const [
// TODO: show widget when broadcasts feature is ready
//_BroadcastWidget(),
_WatchTvWidget(),
_StreamerWidget(),
];

Widget _buildAndroid(BuildContext context, WidgetRef ref) {
return PopScope(
canPop: false,
Expand All @@ -108,11 +115,7 @@ class _WatchScreenState extends ConsumerState<WatchTabScreen> {
return orientation == Orientation.portrait
? ListView(
controller: watchScrollController,
children: const [
_BroadcastWidget(),
_WatchTvWidget(),
_StreamerWidget(),
],
children: watchTabWidgets,
)
: GridView(
controller: watchScrollController,
Expand All @@ -121,11 +124,7 @@ class _WatchScreenState extends ConsumerState<WatchTabScreen> {
crossAxisCount: 2,
childAspectRatio: 0.92,
),
children: const [
_BroadcastWidget(),
_WatchTvWidget(),
_StreamerWidget(),
],
children: watchTabWidgets,
);
},
),
Expand Down Expand Up @@ -156,11 +155,7 @@ class _WatchScreenState extends ConsumerState<WatchTabScreen> {
sliver: orientation == Orientation.portrait
? SliverList(
delegate: SliverChildListDelegate(
const [
_BroadcastWidget(),
_WatchTvWidget(),
_StreamerWidget(),
],
watchTabWidgets,
),
)
: SliverGrid(
Expand All @@ -169,13 +164,7 @@ class _WatchScreenState extends ConsumerState<WatchTabScreen> {
crossAxisCount: 2,
childAspectRatio: 0.92,
),
delegate: SliverChildListDelegate(
const [
_BroadcastWidget(),
_WatchTvWidget(),
_StreamerWidget(),
],
),
delegate: SliverChildListDelegate(watchTabWidgets),
),
),
],
Expand All @@ -197,17 +186,15 @@ Future<void> _refreshData(WidgetRef ref) {
]);
}

// TODO remove this ignore comment when broadcasts feature is ready
// ignore: unused_element
class _BroadcastWidget extends ConsumerWidget {
const _BroadcastWidget();

static const int numberOfItems = 5;

@override
Widget build(BuildContext context, WidgetRef ref) {
// TODO: show widget when broadcasts feature is ready
return const SizedBox.shrink();

// ignore: dead_code
final broadcastList = ref.watch(broadcastsPaginatorProvider);

return broadcastList.when(
Expand Down

0 comments on commit 36d251b

Please sign in to comment.