body: const Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: WebView(
initialUrl: "https://xxxx",
navigationDelegate: (navigation) {
return NavigationDecision.navigate;
},
),
),
When compile, an error happened.
lib/main.dart:84:31: Error: Not a constant expression.
navigationDelegate: (navigation) {
^^^^^^^^^^^^
When I use flutter-2.2.0
and webview_flutter-2.0.13
, the code above works fine. But after i upgraded flutter to 2.5.2 and webview_flutter to 2.0.13, the error happened.
environment(flutter 2.5.2):
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
webview_flutter: 2.1.1