Comments (9)
@suztomo I would be in support of this PR, personally. We have a use case where we show the avatar FileImage from onboarding if we have it, otherwise we show a FirebaseImage, but if it's not available we'd like to show a "anonymous user" style avatar.
from firebase_image.
@suztomo Finally found a way.
By using FadeInImage
,
I got it by:
FadeInImage(
placeholder:
FirebaseImage('gs://XXXXXX.appspot.com/0.jpg'),
image:
FirebaseImage('gs://XXXXXXX.appspot.com/$someID.jpg'),
imageErrorBuilder: (
BuildContext context,
Object error,
StackTrace stackTrace
)
{
print("error");
// return Text("error");
return Image(image : AssetImage('assets/testimage.jpg')) ;
},
)
Glad that I still can use this package, as the features really cool, and suitable for my current project.
from firebase_image.
With Flutter 1.17 stable release, Image widget has now has errorBuilder property.
https://api.flutter.dev/flutter/widgets/Image/errorBuilder.html
To me it seems that FirebaseImage is not the optimal place to handle image loading error. I might revisit this later (as I haven't tried Flutter 1.17), but closing this issue for now.
from firebase_image.
@suztomo Hello. By any chance, any other workaround if want to maintain using FirebaseImage?
from firebase_image.
@mocha234 No. Did you try the errorBuilder.
https://api.flutter.dev/flutter/widgets/Image/errorBuilder.html
from firebase_image.
Works on Image, Image.network, Image.asset etc. as per docs, But not in FirebaseImage, I'm thinking of trying to edit the package from my side and see how it goes, advisable?
from firebase_image.
Your observation indicates that FirebaseImage has not implemented certain features to tell error state. Iโm afraid that I donโt have answer to that. Maybe worth a new GitHub issue?
from firebase_image.
Great. Thank you for sharing the solution!
from firebase_image.
@suztomo But the downfall is, I can't put animation in the placeholder, e.g. Flare loading bar etc.
from firebase_image.
Related Issues (20)
- Resolve Incompatibility with firebase_storage ^5.0.0 HOT 2
- shouldCache seems to be broken HOT 11
- Update firebase_storage dependency to ^7.0.0 HOT 7
- In my flutter application user has to submit or upload 3 images and 2 PDFs randomly. HOT 1
- Feature request: easy way to pre-cache by url HOT 6
- Update Firebase dependency HOT 3
- Warning: Operand of null-aware operation '!' has type 'String' which excludes null. HOT 7
- path with spaces returns object-not-found HOT 1
- TypeError (type 'Null' is not a subtype of type 'Reference') HOT 15
- Null Safety isn't done very well. HOT 1
- Invalid argument: Instance of 'Reference' HOT 1
- Any reason this won't work with Flutter Web? HOT 2
- Optional placeholder widget while loading HOT 2
- Web Support HOT 1
- /C:/Users/kuk/Documents/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_image-1.0.1/lib/src/cache_manager.dart:29:13: Warning: Operand of null-aware operation '!' has type 'String' which excludes null. join((await getDatabasesPath())!, dbName), ^
- update dependencies HOT 4
- umlauts seem break the plugin
- Exception: download-size-exceeded
- Icon progress indicator
- Package needs dependency updates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase_image.