From b159990d3901f067ce39efb664ea179eb448c3b0 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 27 Dec 2019 20:20:35 +0800 Subject: [PATCH] use more final in main --- cyberwow/lib/main.dart | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cyberwow/lib/main.dart b/cyberwow/lib/main.dart index 1c780d2..19c8a3c 100644 --- a/cyberwow/lib/main.dart +++ b/cyberwow/lib/main.dart @@ -49,7 +49,7 @@ void main() { class CyberWOW_App extends StatelessWidget { @override - Widget build(BuildContext context) { + Widget build(final BuildContext context) { SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]); SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); @@ -83,7 +83,7 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv final StreamController inputStreamController = StreamController(); @override - void didChangeAppLifecycleState(AppLifecycleState state) { + void didChangeAppLifecycleState(final AppLifecycleState state) { log.fine('app cycle: ${state}'); setState(() { _notification = state; }); } @@ -94,7 +94,7 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv super.dispose(); } - void _setState(AppState newState) { + void _setState(final AppState newState) { setState ( () => _state = newState @@ -113,11 +113,6 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv return _state; } - - void _updateLoading(LoadingState state, final String msg) { - log.fine('updateLoading: ' + msg); - } - Future buildStateMachine(final BlankState _blankState) async { final loadingText = config.c.splash; LoadingState _loadingState = await _blankState.next(loadingText); @@ -188,7 +183,7 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv buildStateMachine(_blankState); } - Future _exitApp(BuildContext context) async { + Future _exitApp(final BuildContext context) async { log.info("CyberWOW_PageState _exitApp"); WidgetsBinding.instance.removeObserver(this); @@ -203,7 +198,7 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv } @override - Widget build(BuildContext context) { + Widget build(final BuildContext context) { return WillPopScope ( onWillPop: () => _exitApp(context),