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

I/flutter ( 7592): type '(dynamic, dynamic) => Null' is not a subtype of type '(dynamic) => dynamic' of 'f' #31

Open
chaselifetech opened this issue Apr 13, 2020 · 1 comment

Comments

@chaselifetech
Copy link

Im getting this error:
I/flutter ( 7592): type '(dynamic, dynamic) => Null' is not a subtype of type '(dynamic) => dynamic' of 'f'

I believe it is happening on the login.dart section when you click on the login button.

Lind regards
David

@mymakarim
Copy link
Contributor

mymakarim commented Apr 18, 2020

Please follow my instructions, hopefully it solves your problem😊

  1. use JWT Authentication for WP REST API
    You can install it as a plugin
  2. In login.dart
    Find the following code and replace baseUrl with your website URL and YOUR_USERNAME as adminName

wordPress = wp.WordPress( baseUrl: 'http://localhost', authenticator: wp.WordPressAuthenticator.JWT, adminName: '', adminKey: '', );

  1. Find _onValidUser() and replace the function with the following

void _onValidUser(wp.WordPress wordPress, wp.User user) { Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => PostListPage( wordPress: wordPress, user: user, ), ), ); }

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

2 participants