jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.36k stars 215 forks source link

using an asset from a package cause splash screen generation to fail #687

Closed iapicca closed 6 months ago

iapicca commented 7 months ago

Describe the bug

using an asset from a package (see docs), cause splash screen generation to fail

Configuration

dependencies:
# ...
  yakforward_brand:
    git:
      url: https://github.com/yakforward-ou/brand.git
# ...

flutter:
  uses-material-design: true
  assets:
    - packages/yakforward_brand/logo.png

flutter_native_splash:
  color: '#FFFFFF'
  image: packages/yakforward_brand/logo.png
  android: false
  ios: false
  web: true

To Reproduce

logs

dart run flutter_native_splash:create
Building package executable... (1.7s)
Built flutter_native_splash:create.
The file "packages/yakforward_brand/logo.png" set as the parameter "image" was not found.

note that the asset is available in app using

 Image.asset('packages/yakforward_brand/logo.png');

Additional context

flutter doctor ```console Doctor summary (to see all details, run flutter doctor -v): [!] Flutter (Channel stable, 3.19.5, on macOS 14.4.1 23E224 darwin-arm64, locale en-US) ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.3.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/francesco/fvm/versions/stable. Consider adding /Users/francesco/fvm/versions/stable/bin to the front of your path. [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.88.0) [✓] Connected device (2 available) [✓] Network resources ! Doctor found issues in 1 category. ```

cc @jonbhanson

jonbhanson commented 7 months ago

Your project does not have a packages/yakforward_brand folder, so the command does not find any images. Try putting your images in your project's assets folder instead.

iapicca commented 7 months ago

Your project does not have a packages/yakforward_brand folder, so the command does not find any images. Try putting your images in your project's assets folder instead.

@jonbhanson the point is to use an image from a package (see docs), if I have to manually download it into the asset folder it defeat the purpose

jonbhanson commented 6 months ago

This package does not support using a package from a package. Feel free to open a PR adding that feature if you would like.