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

Stricter types with pedantic and fix for #37 #38

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stargazing-dino
Copy link
Contributor

@stargazing-dino stargazing-dino commented Mar 25, 2021

This should fix #37

It also removes several force unwraps (!) and moves strong-mode to avoid implicit casts and dynamics.

@stargazing-dino stargazing-dino changed the title Stricter types with pedantic and fix for #39 Stricter types with pedantic and fix for #37 Mar 25, 2021
@poqueque
Copy link

Any plans on merge this to fix #37?

jessejajit added a commit to jessejajit/firebase_image that referenced this pull request Apr 29, 2021
…try/catch in CacheManager.get() with Reference toMap issue.
@jessejajit
Copy link

jessejajit commented Apr 29, 2021

I've run into the same thing. For anyone wanting a temporary pubspec.yaml fix to keep going, I've created a fork you may use. You may also fork your own for safety+security. I simply patched in the patch from @Nolence (Thank you!).

This also includes an issue I was having with FirebaseImageObject.fromMap and Reference. Rather than find a final solution I've simply thrown in a try/catch and I'm back up and running.

#  firebase_image: ^1.0.1
  firebase_image:
    git:
      url: git://github.com/blinkin/firebase_image.git
      ref: issue37_fix

Copy link
Owner

@mattreid1 mattreid1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job! Just needs a couple of things then I'll release it.

@@ -26,7 +27,7 @@ class FirebaseImageCacheManager {

Future<void> open() async {
db = await openDatabase(
join((await getDatabasesPath())!, dbName),
join((await getDatabasesPath()), dbName),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the error The argument type 'String?' can't be assigned to the parameter type 'String'.dart(argument_type_not_assignable) here... Any ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's odd, I don't think it returns a nullable string anymore.

Looking at ^2.0.0+3 of sqflite, all their uses of getDatabasesPath have a return type of Future<String>

lib/src/cache_manager.dart Outdated Show resolved Hide resolved
lib/src/firebase_image.dart Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@stargazing-dino
Copy link
Contributor Author

This ready to be reviewed again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning: Operand of null-aware operation '!' has type 'String' which excludes null.
4 participants