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 createState() => _ShuffleScreenState(); } class _ShuffleScreenState extends State { @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()); } }