Skip to content

on State changed not listening #81

@rickyazhari

Description

@rickyazhari

i try to get web state to make some loading animation before show webview. but it did not listen at all. here sample original case

class _FullWeb extends State<FullWeb>{

   FlutterWebviewPlugin wv;
  
   @override
   initState(){
      wv = new FlutterWebviewPlugin();
      wv.onStateChanged.listen(webStateChanged);
   }
   
    @override
     Widget body(BuildContext context){
          return new Scaffold(
               body: new Builder(
                       builder: (parent) => buildbody
                )
          );
     }

   Widget buildBody(BuildContext context){
         wv.launch(url);
   }

   void webStateChanged(WebViewStateChanged change){
    Log.write("==============");
    Log.write("index : "+change.type.index.toString());
    Log.write("state : "+change.toString());
    Log.write("Nav type: "+change.navigationType.toString());
    Log.write("==============");
  }

Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.13.4 17E202, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[!] iOS toolchain - develop for iOS devices (Xcode 9.3.1)
! CocoaPods out of date (1.5.0 is recommended).
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To upgrade:
brew upgrade cocoapods
pod setup
[✓] Android Studio (version 3.0)
[✓] VS Code (version 1.23.1)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions