Fix web networkimage

This commit is contained in:
Christian Pauly 2020-05-14 10:04:16 +02:00
parent d220e1bb8d
commit 6ec481f09f
4 changed files with 63 additions and 78 deletions

View file

@ -42,9 +42,11 @@ class Avatar extends StatelessWidget {
child: CircleAvatar( child: CircleAvatar(
radius: size / 2, radius: size / 2,
backgroundImage: !noPic backgroundImage: !noPic
? AdvancedNetworkImage( ? kIsWeb
? NetworkImage(src)
: AdvancedNetworkImage(
src, src,
useDiskCache: !kIsWeb, useDiskCache: true,
) )
: null, : null,
backgroundColor: noPic backgroundColor: noPic

View file

@ -51,9 +51,11 @@ class ContentBanner extends StatelessWidget {
? Image( ? Image(
height: 300, height: 300,
fit: BoxFit.cover, fit: BoxFit.cover,
image: AdvancedNetworkImage( image: kIsWeb
? NetworkImage(src)
: AdvancedNetworkImage(
src, src,
useDiskCache: !kIsWeb, useDiskCache: true,
), ),
) )
: Icon(defaultIcon, size: 300) : Icon(defaultIcon, size: 300)

View file

@ -335,9 +335,11 @@ class _EmoteImage extends StatelessWidget {
method: ThumbnailMethod.scale, method: ThumbnailMethod.scale,
); );
return Image( return Image(
image: AdvancedNetworkImage( image: kIsWeb
? NetworkImage(url)
: AdvancedNetworkImage(
url, url,
useDiskCache: !kIsWeb, useDiskCache: true,
), ),
fit: BoxFit.contain, fit: BoxFit.contain,
width: size, width: size,

View file

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "1.0.3"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.39.8" version: "0.39.4"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -91,7 +91,7 @@ packages:
name: coverage name: coverage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.13.9" version: "0.13.6"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -119,7 +119,7 @@ packages:
name: dart_style name: dart_style
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.6" version: "1.3.3"
encrypted_moor: encrypted_moor:
dependency: "direct main" dependency: "direct main"
description: description:
@ -151,14 +151,14 @@ packages:
name: file_picker name: file_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.0+1" version: "1.4.3+2"
firebase_messaging: firebase_messaging:
dependency: "direct main" dependency: "direct main"
description: description:
name: firebase_messaging name: firebase_messaging
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.15" version: "6.0.13"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -170,14 +170,14 @@ packages:
name: flutter_advanced_networkimage name: flutter_advanced_networkimage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.7.0" version: "0.6.4"
flutter_launcher_icons: flutter_launcher_icons:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_launcher_icons name: flutter_launcher_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.7.5" version: "0.7.4"
flutter_local_notifications: flutter_local_notifications:
dependency: "direct main" dependency: "direct main"
description: description:
@ -204,20 +204,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.6" version: "0.0.6"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.7"
flutter_secure_storage: flutter_secure_storage:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_secure_storage name: flutter_secure_storage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.3.3" version: "3.3.1+1"
flutter_slidable: flutter_slidable:
dependency: "direct main" dependency: "direct main"
description: description:
@ -297,7 +290,7 @@ packages:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.4" version: "3.1.3"
image: image:
dependency: transitive dependency: transitive
description: description:
@ -311,14 +304,7 @@ packages:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.6+1" version: "0.6.2+3"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -339,7 +325,7 @@ packages:
name: io name: io
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.4" version: "0.3.3"
js: js:
dependency: transitive dependency: transitive
description: description:
@ -353,14 +339,14 @@ packages:
name: link_text name: link_text
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.2" version: "0.1.1"
localstorage: localstorage:
dependency: "direct main" dependency: "direct main"
description: description:
name: localstorage name: localstorage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.2+5" version: "3.0.1+4"
logging: logging:
dependency: transitive dependency: transitive
description: description:
@ -432,14 +418,14 @@ packages:
name: node_interop name: node_interop
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.1" version: "1.0.3"
node_io: node_io:
dependency: transitive dependency: transitive
description: description:
name: node_io name: node_io
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.1" version: "1.0.1+2"
node_preamble: node_preamble:
dependency: transitive dependency: transitive
description: description:
@ -469,7 +455,14 @@ packages:
name: package_config name: package_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.3" version: "1.1.0"
package_resolver:
dependency: transitive
description:
name: package_resolver
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.10"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -497,21 +490,7 @@ packages:
name: path_provider name: path_provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.6.8" version: "1.5.1"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+2"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
pedantic: pedantic:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -546,7 +525,7 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.1"
pointycastle: pointycastle:
dependency: transitive dependency: transitive
description: description:
@ -567,7 +546,7 @@ packages:
name: pub_semver name: pub_semver
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.4" version: "1.4.2"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
@ -588,14 +567,14 @@ packages:
name: receive_sharing_intent name: receive_sharing_intent
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.0+2" version: "1.3.3"
share: share:
dependency: "direct main" dependency: "direct main"
description: description:
name: share name: share
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.4+2" version: "0.6.3+5"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@ -609,7 +588,7 @@ packages:
name: shelf_packages_handler name: shelf_packages_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "1.0.4"
shelf_static: shelf_static:
dependency: transitive dependency: transitive
description: description:
@ -635,7 +614,7 @@ packages:
name: source_map_stack_trace name: source_map_stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "1.1.5"
source_maps: source_maps:
dependency: transitive dependency: transitive
description: description:
@ -656,7 +635,7 @@ packages:
name: sqflite name: sqflite
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0+1" version: "1.2.0"
sqflite_common: sqflite_common:
dependency: transitive dependency: transitive
description: description:
@ -698,7 +677,7 @@ packages:
name: synchronized name: synchronized
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.1.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -712,7 +691,7 @@ packages:
name: test name: test
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.14.3" version: "1.13.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
@ -726,7 +705,7 @@ packages:
name: test_core name: test_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.4" version: "0.3.1"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -740,14 +719,14 @@ packages:
name: universal_html name: universal_html
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.2" version: "1.1.12"
universal_io: universal_io:
dependency: transitive dependency: transitive
description: description:
name: universal_io name: universal_io
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "0.8.6"
unorm_dart: unorm_dart:
dependency: transitive dependency: transitive
description: description:
@ -761,28 +740,28 @@ packages:
name: url_launcher name: url_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.4.7" version: "5.4.1"
url_launcher_macos: url_launcher_macos:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_macos name: url_launcher_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1+5" version: "0.0.1+2"
url_launcher_platform_interface: url_launcher_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_platform_interface name: url_launcher_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.7" version: "1.0.5"
url_launcher_web: url_launcher_web:
dependency: "direct main" dependency: "direct main"
description: description:
name: url_launcher_web name: url_launcher_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.1+5" version: "0.1.0+2"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -796,14 +775,14 @@ packages:
name: vm_service name: vm_service
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.4" version: "2.3.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
name: watcher name: watcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.7+15" version: "0.9.7+13"
web_socket_channel: web_socket_channel:
dependency: transitive dependency: transitive
description: description:
@ -824,7 +803,7 @@ packages:
name: webview_flutter name: webview_flutter
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.21" version: "0.3.19+9"
xml: xml:
dependency: transitive dependency: transitive
description: description:
@ -838,7 +817,7 @@ packages:
name: yaml name: yaml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.1" version: "2.2.0"
zone_local: zone_local:
dependency: transitive dependency: transitive
description: description: