Put opacity image source inside "Sample code" (#22385)

See https://github.com/flutter/flutter/pull/22278#pullrequestreview-159230244
This commit is contained in:
liyuqian 2018-09-28 11:10:11 -07:00 committed by GitHub
parent a0944bb228
commit 598ef49051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,12 +152,16 @@ class Directionality extends InheritedWidget {
/// ## Transparent image /// ## Transparent image
/// ///
/// If only a single [Image] needs to be composited with an opacity between 0.0 /// If only a single [Image] needs to be composited with an opacity between 0.0
/// and 1.0, it's much faster to directly use [Image] as following: /// and 1.0, it's much faster to directly use [Image].
///
/// ### Sample code
///
/// This example draws an [Image] with 0.5 opacity:
/// ///
/// ```dart /// ```dart
/// Image( /// Image.network(
/// image: image, /// 'https://github.com/flutter/flutter_gallery_assets/raw/master/lib/products/backpack.png',
/// color: Color.fromRGBO(255, 255, 255, opacity), /// color: Color.fromRGBO(255, 255, 255, 0.5),
/// colorBlendMode: BlendMode.modulate /// colorBlendMode: BlendMode.modulate
/// ) /// )
/// ``` /// ```