OpenMediacenterMobileFlutter/lib/navigation/shuffle_screen.dart

50 lines
1.3 KiB
Dart
Raw Permalink Normal View History

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(
2022-08-30 09:57:50 +00:00
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,
),
],
2022-08-25 20:20:25 +00:00
),
),
drawer: MyDrawer());
}
}