fancy_shimmer_image 2.0.0-nullsafety.0 fancy_shimmer_image: ^2.0.0-nullsafety.0 copied to clipboard
Package for easy use of images that are automatically cacheable and have a beautiful on the fly (but it can be configured) shimmer effect while loading
import 'package:fancy_shimmer_image/fancy_shimmer_image.dart';
import 'package:flutter/material.dart';
import 'data.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 5,
crossAxisSpacing: 5,
childAspectRatio: 1,
),
itemBuilder: (_, i) => FancyShimmerImage(
imageUrl: dataDefault[i].url,
shimmerBaseColor: dataDefault[i].shimmerBaseColor,
shimmerHighlightColor: dataDefault[i].shimmerHighlightColor,
shimmerBackColor: dataDefault[i].shimmerBackColor,
errorWidget: dataDefault[i].errorWidget,
),
itemCount: 15,
),
),
);
}
}