Skip to content

Commit

Permalink
## 3.6.0 * Migrate to 3.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zmtzawqlp committed Aug 17, 2023
1 parent dcc13d1 commit ed0d441
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.6.0

* Migrate to 3.13.0

## 3.5.3

* upgrade http to 1.0.0
Expand Down
9 changes: 3 additions & 6 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
# Android Studio, and the `flutter analyze` command.

analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning
Expand Down Expand Up @@ -103,12 +100,12 @@ linter:
- hash_and_equals
- implementation_imports
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
- iterable_contains_unrelated_type
# - iterable_contains_unrelated_type
# - join_return_with_assignment # not yet tested
- library_names
- library_prefixes
# - lines_longer_than_80_chars # not yet tested
- list_remove_unrelated_type
# - list_remove_unrelated_type
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
# - missing_whitespace_between_adjacent_strings # not yet tested
- no_adjacent_strings_in_list
Expand Down Expand Up @@ -137,7 +134,7 @@ linter:
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
# - prefer_double_quotes # opposite of prefer_single_quotes
- prefer_equal_for_default_values
# - prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_in_for_each
Expand Down
8 changes: 8 additions & 0 deletions lib/src/network/network_image_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ class ExtendedNetworkImageProvider
if (printError) {
print(e);
}
// [ExtendedImage.clearMemoryCacheIfFailed] can clear cache
// Depending on where the exception was thrown, the image cache may not
// have had a chance to track the key in the cache at all.
// Schedule a microtask to give the cache a chance to add the key.
// scheduleMicrotask(() {
// PaintingBinding.instance.imageCache.evict(key);
// });
// rethrow;
} finally {
await chunkEvents?.close();
}
Expand Down
13 changes: 7 additions & 6 deletions lib/src/network/network_image_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
// ignore_for_file: implementation_imports

import 'dart:async';
import 'dart:typed_data';
import 'dart:js_interop';
import 'dart:ui' as ui;

import 'package:extended_image_library/src/extended_image_provider.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/src/services/dom.dart';
import 'package:http_client_helper/http_client_helper.dart';
import 'package:js/js.dart';

import 'extended_network_image_provider.dart' as image_provider;

Expand All @@ -22,7 +21,7 @@ typedef HttpRequestFactory = DomXMLHttpRequest Function();

/// Default HTTP client.
DomXMLHttpRequest _httpClient() {
return createDomXMLHttpRequest();
return DomXMLHttpRequest();
}

/// Creates an overridable factory function.
Expand Down Expand Up @@ -163,7 +162,7 @@ class ExtendedNetworkImageProvider
});
}

request.addEventListener('load', allowInterop((DomEvent e) {
request.addEventListener('load', createDomEventListener((DomEvent e) {
final int? status = request.status;
final bool accepted = status! >= 200 && status < 300;
final bool fileUri = status == 0; // file:// URIs have status of 0.
Expand All @@ -181,13 +180,15 @@ class ExtendedNetworkImageProvider
}
}));

request.addEventListener('error', allowInterop(completer.completeError));
request.addEventListener(
'error', createDomEventListener(completer.completeError));

request.send();

await completer.future;

final Uint8List bytes = (request.response as ByteBuffer).asUint8List();
final Uint8List bytes =
(request.response! as JSArrayBuffer).toDart.asUint8List();

if (bytes.lengthInBytes == 0) {
throw NetworkImageLoadException(
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: extended_image_library
description: package library for extended_image, extended_text and extended_text_field, provide common base class.
version: 3.5.3
version: 3.6.0
homepage: https://github.com/fluttercandies/extended_image_library

environment:
sdk: '>=2.19.0 <4.0.0'
flutter: '>=3.7.0'
flutter: '>=3.13.0'

dependencies:
crypto: ^3.0.0
Expand Down

0 comments on commit ed0d441

Please sign in to comment.