So , there is this package which doesn't have null safety in any of its versions. Is there any way i can use it inside my project where i am using null safety.
-
heve you pubspec fro the specific lib, maybe you need to upgrade version. – Jitesh Mohite Jul 25 '21 at 11:28
-
There is no null-safety version available – Farhan Syedain Jul 25 '21 at 11:36
-
then update pubspec lib version, it should work – Jitesh Mohite Jul 25 '21 at 11:40
4 Answers
You should not use non null-safe packages in a null safe app.
You can try to migrate it yourself (clone the repo, make the changes, etc...)
I've checked github_sign_in's github repo and found that there's a pending pull request with null-safety.
That request goes from this repository which is null-safe.
You can use it (at your own risk) instead of the original one:
dependencies:
github_sign_in:
git:
https://github.com/Gene-Dana/dart-github-sign-in
PS. Note that it does not support Flutter Web (as from the comments).

- 3,074
- 1
- 17
- 23
So, in case your app depends on some packages which don't have null safety. You can run your app with unsound null safety. For that run this command.
flutter run --no-sound-null-safety
For dart files :
dart --no-sound-null-safety run
So , what basically this does is runs some of your code with null safety and the part that is not eligible for null safety without null safety.
Reference from this article

- 408
- 3
- 12
As your IDE says you would have to migrate the package yourself otherwise it won't be possible. If you want to learn more about migrating to null safety you can refer to the Dart Docs

- 887
- 4
- 15