Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
740 stars 429 forks source link

on every start/restart warning: Operand of null-aware operation #299

Closed MohamedEL-Torky closed 3 years ago

MohamedEL-Torky commented 3 years ago

🐛 Bug Report

I'm using Flutter cached network image which depends on this package. on every hot restart or cold start, I'm getting this error message from the internals of this package.

../../../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cache_manager-3.0.0-nullsafety.1/lib/src/storage/cache_info_repositories/cache_object_provider.dart:208:29: Warning: Operand of null-aware operation '!' has type 'String' which excludes null.
    final oldDbPath = join((await getDatabasesPath())!, '$databaseName.db');

Version: 3.0.0-nullsafety.1

Platform:

PcolBP commented 3 years ago

Just remove ! operand from fileflutter_cache_manager-3.0.0-nullsafety.1/lib/src/storage/cache_info_repositories/cache_object_provider.dart in line 208:29 till official update come, it occurs after you upgrade sqflite to 2.0.0+3

https://github.com/Baseflow/flutter_cache_manager/pull/278#issuecomment-800169129

ShahoG commented 3 years ago

Can confirm it happens on Android aswell

MohamedEL-Torky commented 3 years ago

@ShahoG Thanks, I've edited the issue report.

zhukeev commented 3 years ago

The same /.pub-cache/hosted/pub.dartlang.org/flutter_cache_manager-3.0.0-nullsafety.1/lib/src/storage/cache_info_repositories/cache_object_provider.dart:208:29: Warning: Operand of null-aware operation '!' has type 'String' which excludes null. final oldDbPath = join((await getDatabasesPath())!, '$databaseName.db'); ^

knnkrt commented 3 years ago

Same issue. How to solve this.

renefloor commented 3 years ago

Fixed in 3.0.0-nullsafety.2