pikapika/lib/screens/RandomComicsScreen.dart

38 lines
994 B
Dart

import 'package:flutter/material.dart';
import 'package:pikapi/basic/Entities.dart';
import 'package:pikapi/basic/Method.dart';
import 'package:pikapi/basic/config/ListLayout.dart';
import 'package:pikapi/basic/config/ShadowCategories.dart';
import 'components/ComicListBuilder.dart';
// 随机漫画页面
class RandomComicsScreen extends StatefulWidget {
@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
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('随机本子'),
actions: [
shadowCategoriesActionButton(context),
chooseLayoutAction(context),
],
),
body: ComicListBuilder(_future, _reload),
);
}
}