-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load a picture in case the given picture doesn't exists. #1044
Comments
@aggeloskoutanis Consider using the null check operator or the if condition in your code to handle null values. Developers should refrain from creating default icons since different developers require different icons to suit their needs. |
I don't suggest putting a default icon but exporting an error builder, where every developer can insert their Widget, which I would use to display my Error icon. Check for example Image.asset() from Flutter SDK. |
Hello, first of all, thanks for this great package. Moving on, I would like to express a suggestion that might be handy in some situations.
I work on a project where I fetch some courier companies from the server and then I iterate them and create a list of couriers with the name and the picture of the courier company.
The courier images are stored in the assets folder and are rendered to the user using SvgPicture.asset() constructor.
The problem:
Sometimes, we introduce new couriers that the old mobile clients don't have the necessary data to display (i.ie.: the courier logo).
The solution:
Here, it would have been helpful if SvgPicture.asset() constructor had an errorBuilder that renders a default courier icon if the asset is not found.
The text was updated successfully, but these errors were encountered: