Hello I'm a new flutter user by trying the getx method, this time I have a problem when I want to call the view, the error says `
The argument type 'Null' can't be assigned to the parameter type 'ApiRepository'.
To solve this problem, do you think anyone can help me to solve this problem?
Here is the code snippet
main_tab.dart (This Error)
home_controller.dart
CodePudding user response:
The error message says clearly.
Your param apiRespostiry
can't access a null value.
So, you can do two things:
- Don't pass a null value
- use ? =>
final ApiRepository? apiRepository