Revert "flutter: Remove unused functions"

Restore

    didPush
    didPopNext
    didPushNext
    didPop
    didChangeDependencies
    buildManualPanel

to fix setoption not called.

This commit reverts 5884fa4c5f
This commit is contained in:
Calcitem 2021-03-29 02:16:45 +08:00
parent b4974d8e20
commit 6a8644133c
1 changed files with 49 additions and 0 deletions

View File

@ -756,6 +756,28 @@ class _GamePageState extends State<GamePage> with RouteAware {
);
}
Widget buildManualPanel(String text) {
//
final manualStyle = TextStyle(
fontSize: 18,
color: UIColors.darkTextSecondaryColor,
height: 1.5,
);
return Expanded(
child: Container(
margin: EdgeInsets.symmetric(vertical: 16),
child: SingleChildScrollView(child: Text(text, style: manualStyle)),
),
);
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute<dynamic>);
}
@override
Widget build(BuildContext context) {
//
@ -777,4 +799,31 @@ class _GamePageState extends State<GamePage> with RouteAware {
super.dispose();
routeObserver.unsubscribe(this);
}
@override
void didPush() {
final route = ModalRoute.of(context)!.settings.name;
print('Game Page didPush route: $route');
widget.engine.setOptions();
}
@override
void didPopNext() {
final route = ModalRoute.of(context)!.settings.name;
print('Game Page didPopNext route: $route');
widget.engine.setOptions();
}
@override
void didPushNext() {
final route = ModalRoute.of(context)!.settings.name;
print('Game Page didPushNext route: $route');
widget.engine.setOptions();
}
@override
void didPop() {
final route = ModalRoute.of(context)!.settings.name;
print('Game Page didPop route: $route');
}
}