OpenMediacenterMobileFlutter/lib/navigation/shuffle_screen.dart
lukas-heiligenbrunner 9ef317f0ba outsourced lots of api calls to api folder
centered error message when failed loading video feed
display server url on settings page
2022-10-15 20:28:31 +02:00

50 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import '../api/video_api.dart';
import '../drawer/my_drawer.dart';
import '../preview/preview_grid.dart';
import '../utils/platform.dart';
class ShuffleScreen extends StatefulWidget {
const ShuffleScreen({Key? key}) : super(key: key);
@override
State<ShuffleScreen> createState() => _ShuffleScreenState();
}
class _ShuffleScreenState extends State<ShuffleScreen> {
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Scaffold(
appBar: AppBar(
title: Text("Shuffle"),
),
body: PreviewGrid(
videoLoader: () {
return loadShuffledVideos(
(isTV() ? width ~/ 200 : width ~/ 275) * 2);
},
footerBuilder: (state) => Column(
children: [
const SizedBox(
height: 25,
),
TextButton.icon(
onPressed: () {
state.loadData();
},
icon: const Icon(Icons.update),
label: const Text("Shuffle"),
),
const SizedBox(
height: 25,
),
],
),
),
drawer: MyDrawer());
}
}