|
1 | | -import 'package:cached_network_image/cached_network_image.dart'; |
| 1 | +import 'package:extended_image/extended_image.dart'; |
2 | 2 | import 'package:fluro/fluro.dart'; |
3 | 3 | import 'package:flutter/material.dart'; |
4 | 4 | import 'package:flutter_picgo/components/loading.dart'; |
5 | 5 | import 'package:flutter_picgo/model/uploaded.dart'; |
6 | 6 | import 'package:flutter_picgo/routers/application.dart'; |
7 | 7 | import 'package:flutter_picgo/routers/routers.dart'; |
| 8 | +import 'package:flutter_picgo/utils/extended.dart'; |
8 | 9 | import 'package:flutter_picgo/utils/permission.dart'; |
9 | 10 | import 'package:flutter_picgo/views/album_page/album_page_presenter.dart'; |
10 | 11 | import 'package:permission_handler/permission_handler.dart'; |
@@ -142,34 +143,14 @@ class _AlbumPageState extends State<AlbumPage> implements AlbumPageContract { |
142 | 143 | clipBehavior: Clip.antiAlias, |
143 | 144 | shape: RoundedRectangleBorder( |
144 | 145 | borderRadius: BorderRadiusDirectional.circular(8)), |
145 | | - child: CachedNetworkImage( |
146 | | - imageUrl: _uploadeds[index].path, |
| 146 | + child: ExtendedImage.network( |
| 147 | + _uploadeds[index].path, |
| 148 | + height: 150, |
147 | 149 | fit: BoxFit.cover, |
148 | | - placeholder: (context, url) => Center( |
149 | | - child: Container( |
150 | | - width: 20, |
151 | | - height: 20, |
152 | | - child: CircularProgressIndicator(), |
153 | | - ), |
154 | | - ), |
155 | | - errorWidget: (context, url, error) { |
156 | | - return Container( |
157 | | - color: Colors.grey, |
158 | | - child: Center( |
159 | | - child: Column( |
160 | | - mainAxisAlignment: MainAxisAlignment.center, |
161 | | - children: <Widget>[ |
162 | | - Icon(Icons.error), |
163 | | - SizedBox(height: 2), |
164 | | - Text( |
165 | | - '加载失败', |
166 | | - style: TextStyle(fontSize: 12), |
167 | | - ) |
168 | | - ], |
169 | | - ), |
170 | | - ), |
171 | | - ); |
172 | | - }, |
| 150 | + cache: true, |
| 151 | + border: Border.all(color: Colors.grey, width: 1.0), |
| 152 | + borderRadius: BorderRadius.all(Radius.circular(8)), |
| 153 | + loadStateChanged: (state) => defaultLoadStateChanged(state), |
173 | 154 | ), |
174 | 155 | ), |
175 | 156 | ), |
|
0 commit comments