Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on State changed not listening #81

Closed
rickyazhari opened this issue May 23, 2018 · 3 comments
Closed

on State changed not listening #81

rickyazhari opened this issue May 23, 2018 · 3 comments

Comments

@rickyazhari
Copy link

rickyazhari commented May 23, 2018

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)
}

@rickyazhari
Copy link
Author

after i re update version into the new one. i using version v1.3.0 and upgrade to v1.5.0. On state change has call back but got exception. it said

Exception has occurred. type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>'

in file base.dart.

So i change Map argument from < String, dynamic> into <dynamic, dynamic> in line 159.
i will request pull later.
thanks

@zoechi
Copy link

zoechi commented May 23, 2018

Wrapping the code in ``` would make it readable ;-)
You can still edit above comment and the backticks.
Thanks for the PR :)

@lejard-h
Copy link
Collaborator

should be fix in 0.1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants