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

Update Readme for Null Safety #261

Open
Alfaza0965 opened this issue Feb 19, 2022 · 0 comments
Open

Update Readme for Null Safety #261

Alfaza0965 opened this issue Feb 19, 2022 · 0 comments

Comments

@Alfaza0965
Copy link

Alfaza0965 commented Feb 19, 2022

While attempting to implement using the Getting Started steps I realized that it would be great to add the newer code for the proper version of Null safety. Otherwise user will get the following error:

The argument type 'MeishiForm Function(BuildContext, Map<String, dynamic>)' can't be assigned to the parameter type 'Widget? Function(BuildContext?, Map<String, List<String>>)'.dart[argument_type_not_assignable](https://dart.dev/diagnostics/argument_type_not_assignable)

Change from:

var usersHandler = Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) { return UsersScreen(params["id"][0]); });

Change to:

var usersHandler = Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) { return UsersScreen(params["id"][0]); });

Yeah simple fix. XD

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

1 participant