Advertisement
narimetisaigopi

cache network image

Nov 16th, 2021
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import 'package:cached_network_image/cached_network_image.dart';
  2. import 'package:flutter/material.dart';
  3.  
  4. class HomeScreen extends StatelessWidget {
  5. const HomeScreen({Key? key}) : super(key: key);
  6.  
  7. @override
  8. Widget build(BuildContext context) {
  9. return Scaffold(
  10. body: Column(
  11. children: [
  12. // CachedNetworkImage(
  13. // imageUrl:
  14. // "https://cdn.sanity.io/images/ay6gmb6r/production/52566e987046623a25e2f40a11fa99bbd9f4d4d2-2240x1260.png"),
  15. Container(
  16. height: 500,
  17. width: 500,
  18. decoration: BoxDecoration(
  19. image: DecorationImage(
  20. image: CachedNetworkImageProvider(
  21. "https://cdn.sanity.io/images/ay6gmb6r/production/52566e987046623a25e2f40a11fa99bbd9f4d4d2-2240x1260.png"))),
  22. )
  23. ],
  24. ),
  25. );
  26. }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement