Fakultas Ilmu Komputer UI

Commit a531703a authored by Ardian Ghifari's avatar Ardian Ghifari
Browse files

[GREEN] Add shimmer loading effect to image_holder.dart

parent 7ab25d75
......@@ -2,6 +2,7 @@ import 'package:bisaGo/config/styles.dart';
import 'package:bisaGo/flavor/flavor.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
class ImageHolder extends StatelessWidget {
final String url;
......@@ -76,10 +77,12 @@ class ImageHolder extends StatelessWidget {
fit: BoxFit.cover,
placeholder: (context, _) => const Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(greenPrimary),
placeholder: (context, _) => Container(
child: Shimmer.fromColors(
baseColor: Colors.grey[300],
highlightColor: Colors.grey[100],
enabled: true,
child: Container())),
errorWidget: (context, url, error) =>
const Center(child: Icon(Icons.broken_image, color: Colors.black38)),
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment