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

1,535

Solution 1

Your project cannot opt in to null-safety because one of its dependent packages (splashscreen) has not been migrated to null-safety yet.

https://dart.dev/null-safety/migration-guide

When all of an app’s direct dependencies support null safety, you can run the app with sound null safety.

You can either

  • Ignore the warning and keep using the package at your own risk. You can disable the warning using:

    // ignore: import_of_legacy_library_into_null_safe
    
  • Downgrade your app or each file's Dart SDK version (to 2.11 or older).

  • Do not use the unmigrated package and remove from dependencies.

Solution 2

you can ignore this with :

// ignore: import_of_legacy_library_into_null_safe
Share:
1,535
Admin
Author by

Admin

Updated on December 31, 2022

Comments

  • Admin
    Admin over 1 year

    The imports I am using:

    import 'package:flutter/material.dart';
    import 'package:splashscreen/splashscreen.dart';
    import 'package:imagetotext/homePage.dart';
    

    However, the linter is giving me the following warning:

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

    The dependencies I am using:

      cupertino_icons: ^1.0.3
      splashscreen: ^1.3.3
    

    error image

    problem