I have this very basic test app:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
print("ROOT WIDGET ");
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Container(decoration: BoxDecoration(color: Colors.blue),),
);
}
}
Log output debug:
Launching lib/main.dart on iPhone X in debug mode...
Found saved certificate choice "XXX". To clear, use "flutter config". Signing iOS app for device deployment using developer identity: "XXX"
Running Xcode build...
Xcode build done. 39,4s
Installing and launching...
flutter: ROOT WIDGET
Syncing files to device iPhone X...
flutter: ROOT WIDGET
Log output with flutter run --release
Launching lib/main.dart on iPhone X in release mode...
Found saved certificate choice "XXX". To clear, use "flutter config".
Signing iOS app for device deployment using developer identity: "XXX"
Running pod install...
1,2sRunning Xcode build...
├─Building Dart code... 15,8s├─Generating dSYM file... 0,1s
├─Stripping debug symbols... 0,0s
├─Assembling Flutter resources... 0,7s
└─Compiling, linking and signing... 48,3s
Xcode build done. 67,4s
Installing and launching...
6,8sTo quit, press "q".
flutter: ROOT WIDGET
As you can see it only happens in debug mode.
The reason why I ask is, in my real app, I use a WebView
. The function onWebViewCreated(WebViewController controller)
of the WebView
is only called the first time, so that the WebViewController
is always null in debug mode.