Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter 3.0 fix #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ build/
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
.flutter-plugins-dependencies
4 changes: 3 additions & 1 deletion lib/src/firebase_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

T? _ambiguate<T>(T? value) => value;

class FirebaseImage extends ImageProvider<FirebaseImage> {
// Default: True. Specified whether or not an image should be cached (optional)
final bool shouldCache;
Expand Down Expand Up @@ -105,7 +107,7 @@ class FirebaseImage extends ImageProvider<FirebaseImage> {
}

Future<Codec> _fetchImageCodec() async {
return await PaintingBinding.instance!
return await _ambiguate(PaintingBinding.instance)!
.instantiateImageCodec(await _fetchImage());
}

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ dependencies:
flutter:
sdk: flutter

firebase_core: ^1.7.0
firebase_storage: ^10.0.5
firebase_core: ^2.1.1
firebase_storage: ^11.0.4
sqflite: ^2.0.0+4
path: ^1.8.0
path_provider: ^2.0.5

dev_dependencies:
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1
flutter_test:
sdk: flutter