diff --git a/lib/flutter_cache_manager.dart b/lib/flutter_cache_manager.dart index 551d9943..b66a73ce 100644 --- a/lib/flutter_cache_manager.dart +++ b/lib/flutter_cache_manager.dart @@ -24,15 +24,14 @@ class CacheManager { static CacheManager _instance; static Future getInstance() async { - if (_instance == null) { - await synchronized(_lock, () async { - if (_instance == null) { - _instance = new CacheManager._(); - await _instance._init(); - } - }); - } - return _instance; + return await synchronized(_lock, () async { + if (_instance == null) { + _instance = new CacheManager._(); + await _instance._init(); + } + + return _instance; + }); } CacheManager._();