Add examples and troubleshooting comment for ClipRRect (#101907)
This commit is contained in:
@@ -705,6 +705,27 @@ class ClipRect extends SingleChildRenderObjectWidget {
|
||||
///
|
||||
/// {@youtube 560 315 https://www.youtube.com/watch?v=eI43jkQkrvs}
|
||||
///
|
||||
/// {@tool dartpad}
|
||||
/// This example shows various [ClipRRect]s applied to containers.
|
||||
///
|
||||
/// ** See code in examples/api/lib/widgets/basic/clip_rrect.0.dart **
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// ## Troubleshooting
|
||||
///
|
||||
/// ### Why doesn't my [ClipRRect] child have rounded corners?
|
||||
///
|
||||
/// When a [ClipRRect] is bigger than the child it contains, its rounded corners
|
||||
/// could be drawn in unexpected positions. Make sure that [ClipRRect] and its child
|
||||
/// have the same bounds (by shrinking the [ClipRRect] with a [FittedBox] or by
|
||||
/// growing the child).
|
||||
///
|
||||
/// {@tool dartpad}
|
||||
/// This example shows a [ClipRRect] that adds round corners to an image.
|
||||
///
|
||||
/// ** See code in examples/api/lib/widgets/basic/clip_rrect.1.dart **
|
||||
/// {@end-tool}
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [CustomClipper], for information about creating custom clips.
|
||||
|
||||
Reference in New Issue
Block a user