flutter_wordpress
flutter_wordpress copied to clipboard
I/flutter ( 7592): type '(dynamic, dynamic) => Null' is not a subtype of type '(dynamic) => dynamic' of 'f'
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
Please follow my instructions, hopefully it solves your problem😊
- use JWT Authentication for WP REST API You can install it as a plugin
- 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: '', );
- 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, ), ), ); }