flutter_native_splash icon indicating copy to clipboard operation
flutter_native_splash copied to clipboard

Package is broken

Open karroze opened this issue 9 months ago • 2 comments

Describe the bug

Running dart run flutter_native_splash:create results in multiple errors:

Building package executable... 
Failed to build flutter_native_splash:create:
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/android.dart:263:12: Error: Type 'Image' not found.
  required Image image,
           ^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/web.dart:241:12: Error: Type 'Image' not found.
  required Image image,
           ^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/cli_commands.dart:322:19: Error: Method not found: 'decodeImage'.
    final image = decodeImage(File(imageSource).readAsBytesSync());
                  ^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/cli_commands.dart:329:26: Error: Method not found: 'encodePng'.
      ..writeAsBytesSync(encodePng(image));
                         ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/android.dart:232:19: Error: Method not found: 'decodeImage'.
    final image = decodeImage(File(imagePath).readAsBytesSync());
                  ^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/android.dart:263:12: Error: 'Image' isn't a type.
  required Image image,
           ^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/android.dart:275:26: Error: Undefined name 'Interpolation'.
          interpolation: Interpolation.average,
                         ^^^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/android.dart:271:25: Error: Method not found: 'copyResize'.
        final newFile = copyResize(
                        ^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/android.dart:287:33: Error: Method not found: 'encodePng'.
        await file.writeAsBytes(encodePng(newFile));
                                ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:72:25: Error: Method not found: 'Image'.
    final splashImage = Image(width: 1, height: 1);
                        ^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:77:29: Error: Method not found: 'encodePng'.
      file.writeAsBytesSync(encodePng(splashImage));
                            ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:185:17: Error: Method not found: 'decodeImage'.
  final image = decodeImage(File(imagePath).readAsBytesSync());
                ^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:198:26: Error: Undefined name 'Interpolation'.
          interpolation: Interpolation.average,
                         ^^^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:194:25: Error: Method not found: 'copyResize'.
        final newFile = copyResize(
                        ^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:203:33: Error: Method not found: 'encodePng'.
        await file.writeAsBytes(encodePng(newFile));
                                ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:341:19: Error: Method not found: 'decodeImage'.
    final image = decodeImage(File(imagePath).readAsBytesSync());
                  ^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:366:22: Error: Method not found: 'decodeImage'.
    final branding = decodeImage(File(brandingImagePath).readAsBytesSync());
                     ^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:429:24: Error: Method not found: 'Image'.
    final background = Image(width: 1, height: 1);
                       ^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:434:7: Error: Method not found: 'ColorRgb8'.
      ColorRgb8(redChannel, greenChannel, blueChannel),
      ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:438:27: Error: Method not found: 'encodePng'.
    file.writeAsBytesSync(encodePng(background));
                          ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:449:24: Error: Method not found: 'Image'.
    final background = Image(height: 1, width: 1);
                       ^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:453:22: Error: Method not found: 'ColorRgb8'.
    background.clear(ColorRgb8(redChannel, greenChannel, blueChannel));
                     ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/ios.dart:456:27: Error: Method not found: 'encodePng'.
    file.writeAsBytesSync(encodePng(background));
                          ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/web.dart:226:19: Error: Method not found: 'decodeImage'.
    final image = decodeImage(File(imagePath).readAsBytesSync());
                  ^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/web.dart:241:12: Error: 'Image' isn't a type.
  required Image image,
           ^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/web.dart:247:20: Error: Undefined name 'Interpolation'.
    interpolation: Interpolation.average,
                   ^^^^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/web.dart:243:19: Error: Method not found: 'copyResize'.
  final newFile = copyResize(
                  ^^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/web.dart:253:43: Error: Undefined name 'encodeGif'.
    (template.fileName.endsWith('.gif') ? encodeGif : encodePng)(newFile),
                                          ^^^^^^^^^
../.pub-cache/hosted/pub.dev/flutter_native_splash-2.4.5/lib/web.dart:253:55: Error: Undefined name 'encodePng'.
    (template.fileName.endsWith('.gif') ? encodeGif : encodePng)(newFile),
                                                      ^^^^^^^^^

Configuration

• Flutter version 3.29.2 on channel stable at /Users/****/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c236373904 (12 days ago), 2025-03-13 16:17:06 -0400
    • Engine revision 18b71d647a
    • Dart version 3.7.2
    • DevTools version 2.42.3

flutter_native_splash.yaml

flutter_native_splash:
  color: "#ffffff"
  background_image: "assets/images/splash.png"

Device: There's no device

To Reproduce Run create command

karroze avatar Mar 25 '25 17:03 karroze

So this package is discontinued then?

karroze avatar Apr 06 '25 06:04 karroze

I ran the dart run flutter_native_splash:create command with this packages example in the latest version of Flutter and I was not able to reproduce this problem. What happens when you run dart run flutter_native_splash:create with this project's example?

jonbhanson avatar Apr 06 '25 14:04 jonbhanson