Improve docs of ImageFiltered and BackdropFilter (#65503)

This commit is contained in:
Filip Hracek
2020-09-14 17:57:08 -07:00
committed by GitHub
parent 039f1cf853
commit 5b76b350b6
2 changed files with 12 additions and 0 deletions

View File

@@ -384,8 +384,14 @@ class ShaderMask extends SingleChildRenderObjectWidget {
/// This effect is relatively expensive, especially if the filter is non-local,
/// such as a blur.
///
/// If all you want to do is apply an [ImageFilter] to a single widget
/// (as opposed to applying the filter to everything _beneath_ a widget), use
/// [ImageFiltered] instead. For that scenario, [ImageFiltered] is both
/// easier to use and less expensive than [BackdropFilter].
///
/// See also:
///
/// * [ImageFiltered], which applies an [ImageFilter] to its child.
/// * [DecoratedBox], which draws a background under (or over) a widget.
/// * [Opacity], which changes the opacity of the widget itself.
class BackdropFilter extends SingleChildRenderObjectWidget {

View File

@@ -12,6 +12,12 @@ import 'package:flutter/rendering.dart';
import 'framework.dart';
/// Applies an [ImageFilter] to its child.
///
/// See also:
///
/// * [BackdropFilter], which applies an [ImageFilter] to everything
/// beneath its child.
/// * [ColorFiltered], which applies a [ColorFilter] to its child.
@immutable
class ImageFiltered extends SingleChildRenderObjectWidget {
/// Creates a widget that applies an [ImageFilter] to its child.