2022-04-15 19:57:15 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2022-10-15 18:28:31 +00:00
|
|
|
import '../api/video_api.dart';
|
2022-08-30 21:37:24 +00:00
|
|
|
import '../drawer/my_drawer.dart';
|
2022-08-28 20:51:12 +00:00
|
|
|
import '../preview/preview_grid.dart';
|
2022-08-30 21:37:24 +00:00
|
|
|
import '../utils/platform.dart';
|
2022-04-15 19:57:15 +00:00
|
|
|
|
|
|
|
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;
|
2022-08-29 15:16:51 +00:00
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
2022-08-30 09:57:50 +00:00
|
|
|
title: Text("Shuffle"),
|
2022-08-29 15:16:51 +00:00
|
|
|
),
|
|
|
|
body: PreviewGrid(
|
|
|
|
videoLoader: () {
|
2022-10-15 18:28:31 +00:00
|
|
|
return loadShuffledVideos(
|
|
|
|
(isTV() ? width ~/ 200 : width ~/ 275) * 2);
|
2022-08-29 15:16:51 +00:00
|
|
|
},
|
|
|
|
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
|
|
|
),
|
2022-08-29 15:16:51 +00:00
|
|
|
),
|
|
|
|
drawer: MyDrawer());
|
2022-04-15 19:57:15 +00:00
|
|
|
}
|
|
|
|
}
|