Пример #1
0
        public override Future <_SizeAwareCacheKey> obtainKey(ImageConfiguration configuration)
        {
            Completer completer = null;
            SynchronousFuture <_SizeAwareCacheKey> result = null;

            imageProvider.obtainKey(configuration).then((object key) => {
                // TODO: completer is always null?
                if (completer == null)
                {
                    result = new SynchronousFuture <_SizeAwareCacheKey>(new _SizeAwareCacheKey(key, width, height));
                }
                else
                {
                    completer.complete(FutureOr.value(new _SizeAwareCacheKey(key, width, height)));
                }
            });
            if (result != null)
            {
                return(result);
            }

            completer = Completer.create();
            return(completer.future.to <_SizeAwareCacheKey>());
        }