Skip to content

Commit

Permalink
Add some color to the ShapeDecoration.shape docs (flutter#14100)
Browse files Browse the repository at this point in the history
...especially about TextDirection.
  • Loading branch information
Hixie authored Jan 15, 2018
1 parent 09a6df7 commit 299ddb4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/flutter/lib/src/painting/shape_decoration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,20 @@ class ShapeDecoration extends Decoration {
///
/// The [shape] property specifies the outline (border) of the decoration. The
/// shape must not be null.
///
/// ## Directionality-dependent shapes
///
/// Some [ShapeBorder] subclasses are sensitive to the [TextDirection]. The
/// direction that is provided to the border (e.g. for its [ShapeBorder.paint]
/// method) is the one specified in the [ImageConfiguration]
/// ([ImageConfiguration.textDirection]) provided to the [BoxPainter] (via its
/// [BoxPainter.paint method). The [BoxPainter] is obtained when
/// [createBoxPainter] is called.
///
/// When a [ShapeDecoration] is used with a [Container] widget or a
/// [DecoratedBox] widget (which is what [Container] uses), the
/// [TextDirection] specified in the [ImageConfiguration] is obtained from the
/// ambient [Directionality], using [createLocalImageConfiguration].
final ShapeBorder shape;

/// The inset space occupied by the [shape]'s border.
Expand Down

0 comments on commit 299ddb4

Please sign in to comment.