Я использую пакет flutter_native_spla sh. Как исправить эту ошибку?
Pubspe c .yaml -
cupertino_icons: dev_dependencies: flutter_test: sdk: flutter flutter_native_splash: image: assets/splash.png color: “6a1b9a” android: true fill: true # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter:
Ошибка:
PS C:\Users\project> flutter pub pub run flutter_native_splash: create Could not find package "flutter_native_splash". Did you forget to add a dependency?
Добавьте зависимость в dev_dependencies, а не в зависимости
dev_dependencies: flutter_test: sdk: flutter flutter_native_splash: ^0.1.9 //Add this here
Проверяйте отступ при добавлении пакета, .yaml требует отступа, чтобы вложить пакет в зависимость