Unverified Commit 598ef490 authored by liyuqian's avatar liyuqian Committed by GitHub

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

See https://github.com/flutter/flutter/pull/22278#pullrequestreview-159230244
parent a0944bb2
......@@ -152,12 +152,16 @@ class Directionality extends InheritedWidget {
/// ## Transparent image
///
/// 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
/// Image(
/// image: image,
/// color: Color.fromRGBO(255, 255, 255, opacity),
/// Image.network(
/// 'https://github.com/flutter/flutter_gallery_assets/raw/master/lib/products/backpack.png',
/// color: Color.fromRGBO(255, 255, 255, 0.5),
/// colorBlendMode: BlendMode.modulate
/// )
/// ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment