Skip to content

Commit

Permalink
fix: #1667 Added placeholder image (#1733)
Browse files Browse the repository at this point in the history
* Added placeholder image

Added placeholder image when no internet

* Added wifi off icon
  • Loading branch information
vik4114 authored May 10, 2022
1 parent 81afcfc commit 5e736eb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/smooth_app/lib/cards/data_cards/image_upload_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class _ImageUploadCardState extends State<ImageUploadCard> {

@override
Widget build(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size;
// We can already have an _imageProvider for a file that is going to be uploaded
// or an imageUrl for a network image
// or no image yet
Expand All @@ -67,8 +68,19 @@ class _ImageUploadCardState extends State<ImageUploadCard> {
if (_imageProvider != null) {
return GestureDetector(
child: Center(
child:
Image(image: _imageProvider!, fit: BoxFit.cover, height: 1000)),
child: Image(
image: _imageProvider!,
fit: BoxFit.cover,
height: 1000,
errorBuilder: (BuildContext context, Object exception,
StackTrace? stackTrace) {
return Icon(
Icons.wifi_off,
size: screenSize.width / 3,
);
},
),
),
onTap: () {
// if _imageFullProvider is null, we are displaying a small network image in the carousel
// we need to load the full resolution image
Expand Down

0 comments on commit 5e736eb

Please sign in to comment.