pikapika/lib/screens/RandomComicsScreen.dart

49 lines
1.2 KiB
Dart
Raw Normal View History

2021-09-29 23:57:09 +00:00
import 'package:flutter/material.dart';
2021-11-11 03:00:38 +00:00
import 'package:pikapika/basic/Entities.dart';
import 'package:pikapika/basic/Method.dart';
import 'package:pikapika/basic/config/ListLayout.dart';
import 'package:pikapika/basic/config/ShadowCategories.dart';
2021-09-29 23:57:09 +00:00
import 'components/ComicListBuilder.dart';
2022-03-19 04:12:27 +00:00
import 'components/RightClickPop.dart';
2021-09-29 23:57:09 +00:00
2021-10-26 11:04:23 +00:00
// 随机漫画页面
2021-09-29 23:57:09 +00:00
class RandomComicsScreen extends StatefulWidget {
2022-03-19 04:12:27 +00:00
const RandomComicsScreen({Key? key}) : super(key: key);
2021-09-29 23:57:09 +00:00
@override
State<StatefulWidget> createState() => _RandomComicsScreenState();
}
class _RandomComicsScreenState extends State<RandomComicsScreen> {
Future<List<ComicSimple>> _future = method.randomComics();
Future<void> _reload() async {
setState(() {
_future = method.randomComics();
});
}
@override
2022-03-19 04:12:27 +00:00
Widget build(BuildContext context){
2022-03-25 14:57:30 +00:00
return rightClickPop(
child: buildScreen(context),
context: context,
canPop: true,
);
2022-03-19 04:12:27 +00:00
}
Widget buildScreen(BuildContext context) {
2021-09-29 23:57:09 +00:00
return Scaffold(
appBar: AppBar(
title: const Text('随机本子'),
2021-09-29 23:57:09 +00:00
actions: [
shadowCategoriesActionButton(context),
2021-11-04 05:56:25 +00:00
chooseLayoutActionButton(context),
2021-09-29 23:57:09 +00:00
],
),
body: ComicListBuilder(_future, _reload),
);
}
}