Skip to content

Commit

Permalink
Merge pull request flutter#348 from stuartmorgan/import-flutter-image
Browse files Browse the repository at this point in the history
[flutter_image] Import from flutter/flutter_image
  • Loading branch information
stuartmorgan authored May 13, 2021
2 parents 4800be5 + 1f5a1c3 commit 1b5a369
Show file tree
Hide file tree
Showing 16 changed files with 876 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ task:
depends_on:
- format+analyze
- name: test
script: ./script/tool_runner.sh test
# Exclude flutter_image; its tests need a test server, so are run via local_tests.sh
script: ./script/tool_runner.sh test --exclude=flutter_image
depends_on:
- format+analyze
- name: build-apks+java-test
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ These are the available packages in this repository.
| [css\_colors](./packages/css_colors/) | [![pub package](https://img.shields.io/pub/v/css_colors.svg)](https://pub.dev/packages/css_colors) |
| [extension\_google\_sign\_in\_as\_googleapis\_auth](./packages/extension_google_sign_in_as_googleapis_auth/) | [![pub package](https://img.shields.io/pub/v/extension_google_sign_in_as_googleapis_auth.svg)](https://pub.dev/packages/extension_google_sign_in_as_googleapis_auth) |
| [fuchsia\_ctl](./packages/fuchsia_ctl/) | [![pub package](https://img.shields.io/pub/v/fuchsia_ctl.svg)](https://pub.dev/packages/fuchsia_ctl) |
| [flutter\_image](./packages/flutter_image/) | [![pub package](https://img.shields.io/pub/v/flutter_image.svg)](https://pub.dev/packages/flutter_image) |
| [flutter\_lints](./packages/flutter_lints/) | [![pub package](https://img.shields.io/pub/v/flutter_lints.svg)](https://pub.dev/packages/flutter_lints) |
| [flutter\_markdown](./packages/flutter_markdown/) | [![pub package](https://img.shields.io/pub/v/flutter_markdown.svg)](https://pub.dev/packages/flutter_markdown) |
| [multicast\_dns](./packages/multicast_dns/) | [![pub package](https://img.shields.io/pub/v/multicast_dns.svg)](https://pub.dev/packages/multicast_dns) |
Expand Down
11 changes: 11 additions & 0 deletions packages/flutter_image/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.buildlog
.DS_Store
.idea/libraries/*
.idea/vcs.xml
.idea/workspace.xml
.pub/
.settings/
build/
packages
.packages
pubspec.lock
17 changes: 17 additions & 0 deletions packages/flutter_image/.idea/flutter_image.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions packages/flutter_image/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions packages/flutter_image/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
os:
- linux
sudo: false

addons:
apt:
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
sources:
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
packages:
- libstdc++6
- fonts-droid-fallback

before_script:
- git clone https://github.com/flutter/flutter.git -b master
- export PATH=$PATH:$(pwd)/flutter/bin
- export FLUTTER_HOME=$(pwd)/flutter
- flutter doctor

script: ./tool/travis.sh

cache:
directories:
- $HOME/.pub-cache
6 changes: 6 additions & 0 deletions packages/flutter_image/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Below is a list of people and organizations that have contributed
# to the project. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc.
37 changes: 37 additions & 0 deletions packages/flutter_image/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## 4.0.1

- Moved source to flutter/packages

## 4.0.0

- Migrates to null safety
- **Breaking change**: `NetworkImageWithRetry.load` now throws a `FetchFailure` if the fetched image data is zero bytes.

## 3.0.0

* **Breaking change**. Updates for Flutter 1.10.15.

## 2.0.1

- Update Flutter SDK version constraint.

## 2.0.0

* **Breaking change**. Updates for Flutter 1.5.9.

## 1.0.0

* **Breaking change**. SDK constraints to support Flutter beta versions and Dart 2 only.

## 0.0.3

- Moved `flutter_test` to dev_dependencies in `pubspec.yaml`, and fixed issues
flagged by the analyzer.

## 0.0.2

- Add `NetworkImageWithRetry`, an `ImageProvider` with a retry mechanism.

## 0.0.1

- Contains no useful code.
25 changes: 25 additions & 0 deletions packages/flutter_image/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright 2013 The Flutter Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 changes: 22 additions & 0 deletions packages/flutter_image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Image utilities for Flutter

## NetworkImageWithRetry

Use `NetworkImageWithRetry` instead of `Image.network` to load images from the
network with a retry mechanism.

Example:

```dart
var avatar = new Image(
image: new NetworkImageWithRetry('http://example.com/avatars/123.jpg'),
);
```

The retry mechanism may be customized by supplying a custom `FetchStrategy`
function. `FetchStrategyBuilder` is a utility class that helps building fetch
strategy functions.

## Features and bugs

Please file feature requests and bugs at https://github.com/flutter/flutter/issues.
5 changes: 5 additions & 0 deletions packages/flutter_image/lib/flutter_image.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

export 'network.dart';
Loading

0 comments on commit 1b5a369

Please sign in to comment.