Skip to content

Commit

Permalink
v1 http image provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ueman committed Oct 4, 2024
1 parent 7a28d92 commit e65ae95
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
4 changes: 4 additions & 0 deletions http_image_provider/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0

* Remove `HttpImage`, since it was already deprecated for quite a while

## 0.0.3

* Rename `HttpImage` to `HttpImageProvider`
Expand Down
2 changes: 0 additions & 2 deletions http_image_provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ Image(
)
```

If you use [`dio`](https://pub.dev/packages/dio) instead of [http](https://pub.dev/packages/http), try [`dio_image_provider`](https://pub.dev/packages/dio_image_provider)

## Why would I want to use this?

Using the `http` package allows you to dynamically configure the implementation for how requests are made. In particular, this is useful if you need to use `cupertino_http` or `cronet_http` to request images. Another use case is if you need to trace HTTP requests with tools like Sentry.
Expand Down
8 changes: 3 additions & 5 deletions http_image_provider/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import 'package:http_image_provider/http_image_provider.dart';
import 'package:flutter/material.dart';

const Color darkBlue = Color.fromARGB(255, 18, 32, 47);

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: Image(
image: HttpImageProvider(Uri.parse('https://http.cat/200'))),
image: HttpImageProvider(Uri.parse('https://http.cat/200')),
),
),
),
);
Expand Down
3 changes: 0 additions & 3 deletions http_image_provider/lib/http_image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,3 @@ class HttpImageProvider extends ImageProvider<HttpImageProvider> {
String toString() =>
'${objectRuntimeType(this, 'HttpImageProvider')}("$url", scale: $scale)';
}

@Deprecated('Use HttpImageProvider instead')
typedef HttpImage = HttpImageProvider;
9 changes: 5 additions & 4 deletions http_image_provider/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: http_image_provider
description: An image provider which makes use of package:http to instead of dart:io
version: 0.0.3
repository: https://github.com/ueman/image_provider
issue_tracker: https://github.com/ueman/image_provider/issues
version: 1.0.0
repository: https://github.com/ueman/dart-packages
issue_tracker: https://github.com/ueman/dart-packages/issues

topics:
- cupertino-http
- cronet-http
- image-provider
- http

environment:
sdk: '>=3.0.0 <4.0.0'
Expand All @@ -21,4 +22,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0

0 comments on commit e65ae95

Please sign in to comment.