As the question state, is it a good idea to use // ignore: missing_return above the future function where we are using conditions to return answer.
e.g.
Future<UserModel> getProfile() async {
if (_user == null) {
_user = await Provider.of<UserProvider>(context).fetchUserProfile();
} else {
return _user;
}
}
the warning is suppressed when done as below:
// ignore: missing_return
Future<UserModel> getProfile() async {
if (_user == null) {
_user = await Provider.of<UserProvider>(context).fetchUserProfile();
} else {
return _user;
}
}
is this a good practice or what modification should I do to the given code...