Closed michaelnguyen2021 closed 3 years ago
I wanted to report the same issue; found this one was already open. I think it's because the 'close' icon was implemented using an AssetImage; it could be implemented with Icons.close instead.
════════ Exception caught by image resource service ════════════════════════════════════════════════ The following assertion was thrown resolving an image codec: Unable to load asset: packages/rflutter_alert/assets/images/close.png
When the exception was thrown, this was the stack:
i have had same issue but i have solved it .My problem was in the pubspec.yaml i used wrong indentation it should be like this
flutter: [2 whitespaces]assets: [4 whitespaces ]- images/close.png
Same, doesnt seem to be working here either. I notice that it searches for assets/images, which is available in git but not on my local package which flutter installed for me.
Are we supposed to manually download these?
I have faced the same issue, but base on @doganozan solution, i can assure that by placing the flutter: [2space]assets: [4space]- images/close.png
works
EDIT: Does not work after doing a full restart, previously i just performed a hot restart
Ran into the same thing, linking to git inside pubspec.yaml like below worked for me.
rflutter_alert:
git: git://github.com/RatelHub/rflutter_alert.git
@michaelnguyen547 , @ulrichmabou , @baxterhemingway , @tengfone , @angrbrd hate this speech but i have to say: "It works on my machine" :) Can you try the latest version V1.1.0 and be sure whitespaces issue which @doganozan mentioned?
It looks like the only way to get this to work correctly is to install from github? If I use the recommended rflutter_alert: ^1.1.0
and flutter pub get
then it installs the package, however, the package doesn't have any assets so no close image. Seems to me there is a bug in the build. Not sure why there is a difference between using github and not using it.
Also none of the documentation mentions needing to import images. I feel like I'm missing something and this thread is not helping.
my pubspec.yaml:
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
# for alert dialogs
rflutter_alert: ^1.1.0
my packages folder with the package after installing.
Help, I'm still confused.
It looks like the only way to get this to work correctly is to install from github? If I use the recommended
rflutter_alert: ^1.1.0
andflutter pub get
then it installs the package, however, the package doesn't have any assets so no close image. Seems to me there is a bug in the build. Not sure why there is a difference between using github and not using it.Also none of the documentation mentions needing to import images. I feel like I'm missing something and this thread is not helping.
my pubspec.yaml:
dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 # for alert dialogs rflutter_alert: ^1.1.0
my packages folder with the package after installing.
Help, I'm still confused.
Seems as though killing (stopping) the app and starting again from scratch it worked without any errors about the close button.
It looks like the only way to get this to work correctly is to install from github? If I use the recommended
rflutter_alert: ^1.1.0
andflutter pub get
then it installs the package, however, the package doesn't have any assets so no close image. Seems to me there is a bug in the build. Not sure why there is a difference between using github and not using it. Also none of the documentation mentions needing to import images. I feel like I'm missing something and this thread is not helping. my pubspec.yaml:dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 # for alert dialogs rflutter_alert: ^1.1.0
my packages folder with the package after installing.
Help, I'm still confused.
Seems as though killing (stopping) the app and starting again from scratch it worked without any errors about the close button.
Can confirm it works after killing (stopping) the app and starting again worked. Weird how it does not automatically detects the image once we put it in assets/images.
So I'm closing this issue.
The following assertion was thrown resolving an image codec: Unable to load asset: packages/rflutter_alert/assets/images/close.png
When the exception was thrown, this was the stack:
0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)