Search code examples
flutterdartpubspec

'package:splashscreen/splashscreen.dart' is legacy, and should not be imported into a null safe library


how to resolve this error of null safe library in splash screen even though I have added dependency most recent one i.e "splashscreen: ^1.3.5" enter image description here

enter image description here


Solution

  • To import a package without null safety support reduce your flutter version in pubspec.yaml

    Replace environment with bellow version

      environment:
        sdk: ">=2.06.0 <3.0.0"
    

    Note: This is one way to use an external package without null safety support. If it's an existing project check your dependencies for null safety support before migrating.