Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
46c4c5f5
Commit
46c4c5f5
authored
Mar 03, 2017
by
Adam Barth
Committed by
GitHub
Mar 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve ClipRect documentation (#8560)
Fixes #8557
parent
f894edeb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+7
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+48
-0
No files found.
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
46c4c5f5
...
...
@@ -881,6 +881,13 @@ class RenderBackdropFilter extends RenderProxyBox {
/// supply a reclip argument to the constructor of the [CustomClipper]. The
/// custom object will listen to this animation and update the clip whenever the
/// animation ticks, avoiding both the build and layout phases of the pipeline.
///
/// See also:
///
/// * [ClipRect], which can be customized with a [CustomClipper].
/// * [ClipRRect], which can be customized with a [CustomClipper].
/// * [ClipOval], which can be customized with a [CustomClipper].
/// * [ClipPath], which can be customized with a [CustomClipper].
abstract
class
CustomClipper
<
T
>
{
/// Creates a custom clipper.
///
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
46c4c5f5
...
...
@@ -252,6 +252,39 @@ class CustomPaint extends SingleChildRenderObjectWidget {
/// By default, [ClipRect] prevents its child from painting outside its
/// bounds, but the size and location of the clip rect can be customized using a
/// custom [clipper].
///
/// [ClipRect] is commonly used with these widgets, which commonly paint outside
/// their bounds.
///
/// * [CustomPaint]
/// * [CustomSingleChildLayout]
/// * [CustomMultiChildLayout]
/// * [Align] and [Center] (e.g., if [Align.widthFactor] or
/// [Align.heightFactor] is less than 1.0).
/// * [OverflowBox]
/// * [SizedOverflowBox]
///
/// ## Example
///
/// For example, use a clip to show the top half of an [Image], you can use a
/// [ClipRect] combined with an [Align]:
///
/// ```dart
/// new ClipRect(
/// child: new Align(
/// alignment: FractionalOffset.topCenter,
/// heightFactor: 0.5,
/// child: new Image(...),
/// ),
/// ),
/// ```
///
/// See also:
///
/// * [CustomClipper], for information about creating custom clips.
/// * [ClipRRect], for a clip with rounded corners.
/// * [ClipOval], for an elliptical clip.
/// * [ClipPath], for an arbitrarily shaped clip.
class
ClipRect
extends
SingleChildRenderObjectWidget
{
/// Creates a rectangular clip.
///
...
...
@@ -281,6 +314,13 @@ class ClipRect extends SingleChildRenderObjectWidget {
/// By default, [ClipRRect] uses its own bounds as the base rectangle for the
/// clip, but the size and location of the clip can be customized using a custom
/// [clipper].
///
/// See also:
///
/// * [CustomClipper], for information about creating custom clips.
/// * [ClipRect], for more efficient clips without rounded corners.
/// * [ClipOval], for an elliptical clip.
/// * [ClipPath], for an arbitrarily shaped clip.
class
ClipRRect
extends
SingleChildRenderObjectWidget
{
/// Creates a rounded-rectangular clip.
///
...
...
@@ -324,6 +364,14 @@ class ClipRRect extends SingleChildRenderObjectWidget {
/// By default, inscribes an axis-aligned oval into its layout dimensions and
/// prevents its child from painting outside that oval, but the size and
/// location of the clip oval can be customized using a custom [clipper].
/// See also:
///
/// See also:
///
/// * [CustomClipper], for information about creating custom clips.
/// * [ClipRect], for more efficient clips without rounded corners.
/// * [ClipRRect], for a clip with rounded corners.
/// * [ClipPath], for an arbitrarily shaped clip.
class
ClipOval
extends
SingleChildRenderObjectWidget
{
/// Creates an oval-shaped clip.
///
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment