cached_network_image_plus 0.0.5 cached_network_image_plus: ^0.0.5 copied to clipboard
Effortlessly cache network images plus, create rounded corners, and apply customizable shadows for a refined look and feel.
import 'package:cached_network_image_plus/flutter_cached_network_image_plus.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',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("CacheNetworkImagePlus"), centerTitle: true),
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 1,
),
itemBuilder: (_, i) => CacheNetworkImagePlus(
imageUrl: dataDefault[i].url,
margin: EdgeInsets.all(10),
borderRadius: BorderRadius.circular(20),
shimmerBaseColor: dataDefault[i].shimmerBaseColor,
shimmerHighlightColor: dataDefault[i].shimmerHighlightColor,
shimmerBackColor: dataDefault[i].shimmerBackColor,
errorWidget: dataDefault[i].errorWidget,
boxShadow: [
BoxShadow(
color: Colors.grey.shade600,
blurStyle: BlurStyle.outer,
blurRadius: 10)
],
),
itemCount: dataDefault.length,
),
),
);
}
}