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 {
|
class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
|
||||||
late var _tabIndex = 0;
|
late var _tabIndex = 0;
|
||||||
late Future<ComicInfo> _comicFuture = _loadComic();
|
late Future<ComicInfo> _comicFuture = _loadComic();
|
||||||
|
late Key _comicFutureKey = UniqueKey();
|
||||||
late Future<ViewLog?> _viewFuture = _loadViewLog();
|
late Future<ViewLog?> _viewFuture = _loadViewLog();
|
||||||
late Future<List<Ep>> _epListFuture = _loadEps();
|
late Future<List<Ep>> _epListFuture = _loadEps();
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
|
||||||
|
|
||||||
Widget buildScreen(BuildContext context) {
|
Widget buildScreen(BuildContext context) {
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
|
key: _comicFutureKey,
|
||||||
future: _comicFuture,
|
future: _comicFuture,
|
||||||
builder: (BuildContext context, AsyncSnapshot<ComicInfo> snapshot) {
|
builder: (BuildContext context, AsyncSnapshot<ComicInfo> snapshot) {
|
||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
|
@ -96,6 +98,7 @@ class _ComicInfoScreenState extends State<ComicInfoScreen> with RouteAware {
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_comicFuture = _loadComic();
|
_comicFuture = _loadComic();
|
||||||
|
_comicFutureKey = UniqueKey();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -15,7 +15,7 @@ import 'components/RightClickPop.dart';
|
||||||
class GameInfoScreen extends StatefulWidget {
|
class GameInfoScreen extends StatefulWidget {
|
||||||
final String gameId;
|
final String gameId;
|
||||||
|
|
||||||
const GameInfoScreen(this.gameId,{Key? key}):super(key: key);
|
const GameInfoScreen(this.gameId, {Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() => _GameInfoScreenState();
|
State<StatefulWidget> createState() => _GameInfoScreenState();
|
||||||
|
@ -23,9 +23,10 @@ class GameInfoScreen extends StatefulWidget {
|
||||||
|
|
||||||
class _GameInfoScreenState extends State<GameInfoScreen> {
|
class _GameInfoScreenState extends State<GameInfoScreen> {
|
||||||
late var _future = method.game(widget.gameId);
|
late var _future = method.game(widget.gameId);
|
||||||
|
late var _key = UniqueKey();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context){
|
Widget build(BuildContext context) {
|
||||||
return rightClickPop(
|
return rightClickPop(
|
||||||
child: buildScreen(context),
|
child: buildScreen(context),
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -35,6 +36,7 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
||||||
|
|
||||||
Widget buildScreen(BuildContext context) {
|
Widget buildScreen(BuildContext context) {
|
||||||
return FutureBuilder(
|
return FutureBuilder(
|
||||||
|
key: _key,
|
||||||
future: _future,
|
future: _future,
|
||||||
builder: (BuildContext context, AsyncSnapshot<GameInfo> snapshot) {
|
builder: (BuildContext context, AsyncSnapshot<GameInfo> snapshot) {
|
||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
|
@ -48,6 +50,7 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_future = method.game(widget.gameId);
|
_future = method.game(widget.gameId);
|
||||||
|
_key = UniqueKey();
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
@ -86,7 +89,8 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
),
|
),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(5)),
|
||||||
child: MaterialButton(
|
child: MaterialButton(
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
|
@ -151,8 +155,7 @@ class _GameInfoScreenState extends State<GameInfoScreen> {
|
||||||
],
|
],
|
||||||
indicatorColor:
|
indicatorColor:
|
||||||
Theme.of(context).colorScheme.secondary,
|
Theme.of(context).colorScheme.secondary,
|
||||||
labelColor:
|
labelColor: Theme.of(context).colorScheme.secondary,
|
||||||
Theme.of(context).colorScheme.secondary,
|
|
||||||
onTap: (val) async {
|
onTap: (val) async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_tabIndex = val;
|
_tabIndex = val;
|
||||||
|
|
Loading…
Reference in New Issue