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,10 +42,12 @@ class Avatar extends StatelessWidget {
child: CircleAvatar(
radius: size / 2,
backgroundImage: !noPic
? AdvancedNetworkImage(
src,
useDiskCache: !kIsWeb,
)
? kIsWeb
? NetworkImage(src)
: AdvancedNetworkImage(
src,
useDiskCache: true,
)
: null,
backgroundColor: noPic
? name?.color ?? Theme.of(context).secondaryHeaderColor

View file

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

View file

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

View file

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