File tree Expand file tree Collapse file tree 5 files changed +43
-3
lines changed Expand file tree Collapse file tree 5 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
* Fixes image asset link to use image within package.
4
4
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
5
+ * Updates README to improve example of using ` NetworkImageWithRetry ` .
5
6
6
7
## 4.1.9
7
8
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ network with a retry mechanism.
7
7
8
8
Example:
9
9
10
+ <? code-excerpt "example/lib/readme_excerpts.dart (NetworkImageWithRetry)"?>
10
11
``` dart
11
- var avatar = new Image(
12
- image: new NetworkImageWithRetry('http://example.com/avatars/123.jpg'),
12
+ const Image avatar = Image(
13
+ image: NetworkImageWithRetry('http://example.com/avatars/123.jpg'),
13
14
);
14
15
```
15
16
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Flutter Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import 'package:flutter/widgets.dart' ;
6
+ import 'package:flutter_image/flutter_image.dart' ;
7
+
8
+ /// Demonstrates loading an image for the README.
9
+ Image networkImageWithRetry () {
10
+ // #docregion NetworkImageWithRetry
11
+ const Image avatar = Image (
12
+ image: NetworkImageWithRetry ('http://example.com/avatars/123.jpg' ),
13
+ );
14
+ // #enddocregion NetworkImageWithRetry
15
+
16
+ return avatar;
17
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Flutter Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import 'package:flutter/widgets.dart' ;
6
+ import 'package:flutter_image/flutter_image.dart' ;
7
+ import 'package:flutter_image_example/readme_excerpts.dart' ;
8
+ import 'package:flutter_test/flutter_test.dart' ;
9
+
10
+ void main () {
11
+ test ('networkImageWithRetry returns an Image with NetworkImageWithRetry' , () {
12
+ // Ensure that the snippet code runs successfully.
13
+ final Image result = networkImageWithRetry ();
14
+
15
+ // It should have a image property of the right type.
16
+ expect (result.image, isInstanceOf <NetworkImageWithRetry >());
17
+ // And the NetworkImageWithRetry should have a url property.
18
+ final NetworkImageWithRetry networkImage =
19
+ result.image as NetworkImageWithRetry ;
20
+ expect (networkImage.url, equals ('http://example.com/avatars/123.jpg' ));
21
+ });
22
+ }
Original file line number Diff line number Diff line change 8
8
- css_colors
9
9
- espresso
10
10
- extension_google_sign_in_as_googleapis_auth
11
- - flutter_image
12
11
- go_router_builder
13
12
- google_sign_in/google_sign_in
14
13
- image_picker_for_web
You can’t perform that action at this time.
0 commit comments