Appened info screen feature keys
This commit is contained in:
parent
d71d3505ab
commit
1c63c5942c
|
@ -33,6 +33,7 @@ class ComicInfoScreen extends StatefulWidget {
|
|||
class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
|
||||
late var _tabIndex = 0;
|
||||
late Future<ComicInfo> _comicFuture = _loadComic();
|
||||
late Key _comicFutureKey = UniqueKey();
|
||||
late Future<ViewLog?> _viewFuture = _loadViewLog();
|
||||
late Future<List<Ep>> _epListFuture = _loadEps();
|
||||
|
||||
|
@ -85,6 +86,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
|
|||
|
||||
Widget buildScreen(BuildContext context) {
|
||||
return FutureBuilder(
|
||||
key: _comicFutureKey,
|
||||
future: _comicFuture,
|
||||
builder: (BuildContext context, AsyncSnapshot<ComicInfo> snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
|
@ -96,6 +98,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
|
|||
onRefresh: () async {
|
||||
setState(() {
|
||||
_comicFuture = _loadComic();
|
||||
_comicFutureKey = UniqueKey();
|
||||
});
|
||||
},
|
||||
),
|
||||
|
|
|
@ -23,6 +23,7 @@ class GameInfoScreen extends StatefulWidget {
|
|||
|
||||
class _GameInfoScreenState extends State<GameInfoScreen> {
|
||||
late var _future = method.game(widget.gameId);
|
||||
late var _key = UniqueKey();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -35,6 +36,7 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
|||
|
||||
Widget buildScreen(BuildContext context) {
|
||||
return FutureBuilder(
|
||||
key: _key,
|
||||
future: _future,
|
||||
builder: (BuildContext context, AsyncSnapshot<GameInfo> snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
|
@ -48,6 +50,7 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
|||
onRefresh: () async {
|
||||
setState(() {
|
||||
_future = method.game(widget.gameId);
|
||||
_key = UniqueKey();
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
@ -86,7 +89,8 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
|||
bottom: 10,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(5)),
|
||||
child: MaterialButton(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
textColor: Colors.white,
|
||||
|
@ -151,8 +155,7 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
|||
],
|
||||
indicatorColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
labelColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
labelColor: Theme.of(context).colorScheme.secondary,
|
||||
onTap: (val) async {
|
||||
setState(() {
|
||||
_tabIndex = val;
|
||||
|
|
Loading…
Reference in New Issue