Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- Flutter 앱 배포
- MainAxisAlignment
- AppBar
- node.js
- WillPopScope
- InkWell
- ListTile
- Flutter 예제
- Hello World
- Flutter Example
- Snackbar
- ListView.builder
- HTTP
- Flutter 강좌
- Cached Image
- Networking
- Scaffold
- FutureBuilder
- Row Widget
- navigator
- 반석천
- Load Image
- Row
- Column Widget
- listview
- CrossAxisAlignment
- Image.network
- Flutter Tutorial
- flutter
- sqlite
Archives
- Today
- Total
꿈꾸는 시스템 디자이너
Flutter Example - Handle Image | Load Cached Image | cached_network_image plugin 본문
Tutorial/Flutter with App
Flutter Example - Handle Image | Load Cached Image | cached_network_image plugin
독행소년 2019. 10. 7. 13:13* About Plugin
https://pub.dev/packages/cached_network_image
1. Add this to pubspec.yaml file
dependencies:
cached_network_image: ^1.1.1
2. Source Code
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
class LoadCachedNetworkImage extends StatelessWidget {
String url = "https://picsum.photos/300";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Load Image From Network")),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
height: 300,
child: Center(
child: CachedNetworkImage(
imageUrl: url,
placeholder: (context, url) => new CircularProgressIndicator(),
errorWidget: (context, url, error) => new Icon(Icons.error),
),
),
),
Text(url),
Container(
decoration: BoxDecoration(color: Colors.orangeAccent),
margin: const EdgeInsets.all(15),
padding: const EdgeInsets.all(15),
child: Text(
"* Cached images are loaded quickly without re-downloading.",
style: TextStyle(color: Colors.white),
),
)
],
),
);
}
}
▶ Go to Table of Contents | 강의 목차로 이동
※ This example is also available in the Flutter Code Examples app. | 본 예제는 Flutter Code Examples 앱에서도 제공됩니다.
'Tutorial > Flutter with App' 카테고리의 다른 글
Flutter Example - Handle Image | Load Image from Gallery | image_picker plugin (0) | 2019.10.07 |
---|---|
Flutter Example - Handle Image | Fit Image (0) | 2019.10.07 |
Flutter Example - Handle Image | FadeIn Image | transparent_image plugin (0) | 2019.10.07 |
Flutter Example - Handle Image | Load Image from Network (0) | 2019.10.07 |
Flutter Example - Handle Image | Load Image from Asset (0) | 2019.10.07 |
Comments