|
|
|
|
|
|
BoxFit? fit = null, |
|
|
|
Alignment alignment = null, |
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
bool matchTextDirection = false, |
|
|
|
Key key = null |
|
|
|
) : base(key) { |
|
|
|
D.assert(placeholder != null); |
|
|
|
|
|
|
this.fadeInCurve = fadeInCurve ?? Curves.easeIn; |
|
|
|
this.alignment = alignment ?? Alignment.center; |
|
|
|
this.repeat = repeat; |
|
|
|
this.matchTextDirection = matchTextDirection; |
|
|
|
} |
|
|
|
|
|
|
|
public static FadeInImage memoryNetwork( |
|
|
|
|
|
|
BoxFit? fit = null, |
|
|
|
Alignment alignment = null, |
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
bool matchTextDirection = false, |
|
|
|
Key key = null |
|
|
|
) { |
|
|
|
D.assert(placeholder != null); |
|
|
|
|
|
|
fit, |
|
|
|
alignment, |
|
|
|
repeat, |
|
|
|
matchTextDirection |
|
|
|
key |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
AssetBundle bundle = null, |
|
|
|
float placeholderScale = 0.0f, |
|
|
|
float? placeholderScale = null, |
|
|
|
float imageScale = 1.0f, |
|
|
|
TimeSpan? fadeOutDuration = null, |
|
|
|
Curve fadeOutCurve = null, |
|
|
|
|
|
|
BoxFit? fit = null, |
|
|
|
Alignment alignment = null, |
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat, |
|
|
|
bool matchTextDirection = false, |
|
|
|
Key key = null |
|
|
|
) { |
|
|
|
D.assert(placeholder != null); |
|
|
|
|
|
|
D.assert(fadeInCurve != null); |
|
|
|
D.assert(alignment != null); |
|
|
|
var imageProvider = placeholderScale != null |
|
|
|
? new ExactAssetImage(placeholder, bundle: bundle, scale: placeholderScale) |
|
|
|
? new ExactAssetImage(placeholder, bundle: bundle, scale: placeholderScale ?? 1.0f) |
|
|
|
: (ImageProvider) new AssetImage(placeholder, bundle: bundle); |
|
|
|
|
|
|
|
var networkImage = new NetworkImage(image, imageScale); |
|
|
|
|
|
|
fit, |
|
|
|
alignment, |
|
|
|
repeat, |
|
|
|
matchTextDirection |
|
|
|
key |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public readonly BoxFit? fit; |
|
|
|
public readonly Alignment alignment; |
|
|
|
public readonly ImageRepeat repeat; |
|
|
|
public readonly bool matchTextDirection; |
|
|
|
|
|
|
|
|
|
|
|
public override State createState() { |
|
|
|
return new _FadeInImageState(); |
|
|
|
|
|
|
ImageStream oldImageStream = this._imageStream; |
|
|
|
Size size = null; |
|
|
|
if (this.widget.width != null && this.widget.height != null) { |
|
|
|
size = new Size(Convert.ToSingle(this.widget.width), Convert.ToSingle(this.widget.height)); |
|
|
|
size = new Size((int) this.widget.width, (int) this.widget.height); |
|
|
|
} |
|
|
|
|
|
|
|
this._imageStream = provider.resolve(ImageUtils.createLocalImageConfiguration(this.state.context, size)); |
|
|
|