You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Started getting this error:
../../.pub-cache/hosted/pub.dev/get-4.6.5/lib/
get_instance/src/get_instance.dart:281:5:
Error: A non-null value must be returned since
the return type 'S' doesn't allow null.
the referred code is the find fuction in get_instance.dart file:
/// Finds the registered type <[S]> (or [tag]) /// In case of using Get.[create] to register a type <[S]> or [tag], /// it will create an instance each time you call [find]. /// If the registered type <[S]> (or [tag]) is a Controller, /// it will initialize it's lifecycle.Sfind<S>({String? tag}) {
final key =_getKey(S, tag);
if (isRegistered<S>(tag: tag)) {
final dep = _singl[key];
if (dep ==null) {
if (tag ==null) {
throw'Class "$S" is not registered';
} else {
throw'Class "$S" with tag "$tag" is not registered';
}
}
// if (dep.lateRemove != null) {// dep.isDirty = true;// if(dep.fenix)// }/// although dirty solution, the lifecycle starts inside /// `initDependencies`, so we have to return the instance from there /// to make it compatible with `Get.create()`.final i =_initDependencies<S>(name: tag);
return i ?? dep.getDependency() asS;
} else {
// ignore: lines_longer_than_80_chthrow '"$S" not found. You need to call "Get.put($S())" or "Get.lazyPut(()=>$S())"';
}
}
**Reproduction code
Create a new project:
Simply import the package:
to anybody who incurs in this, I solved the issue installing a new instance of flutter and (suggested while running flutter doctor) doing a dart pub cache clean.
Don't really know whether running dart pub cache clean would have been enough.
The suspect that the problem was related to the framework instance came from the fact that downgrading to the flutter previous (and working) version didn't affect the errors in the build process.
Started getting this error:
../../.pub-cache/hosted/pub.dev/get-4.6.5/lib/
get_instance/src/get_instance.dart:281:5:
Error: A non-null value must be returned since
the return type 'S' doesn't allow null.
the referred code is the find fuction in get_instance.dart file:
**Reproduction code
Create a new project:
Simply import the package:
Flutter version is:
I've recently updated from 3.10.3, but even downgrading the error persists.
The text was updated successfully, but these errors were encountered: