Add text border docs (#36485)
This commit is contained in:
parent
0636fb439a
commit
41bc10fa70
@ -166,6 +166,42 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
|
|||||||
/// ```
|
/// ```
|
||||||
/// {@end-tool}
|
/// {@end-tool}
|
||||||
///
|
///
|
||||||
|
/// ### Borders and stroke
|
||||||
|
///
|
||||||
|
/// {@tool sample}
|
||||||
|
/// To create bordered text, a [Paint] with [Paint.style] set to [PaintingStyle.stroke]
|
||||||
|
/// should be provided as a [foreground] paint. The following example uses a [Stack]
|
||||||
|
/// to produce a stroke and fill effect.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// ```dart
|
||||||
|
/// Stack(
|
||||||
|
/// children: <Widget>[
|
||||||
|
/// // Stroked text as border.
|
||||||
|
/// Text(
|
||||||
|
/// 'Greetings, planet!',
|
||||||
|
/// style: TextStyle(
|
||||||
|
/// fontSize: 40,
|
||||||
|
/// foreground: Paint()
|
||||||
|
/// ..style = PaintingStyle.stroke
|
||||||
|
/// ..strokeWidth = 6
|
||||||
|
/// ..color = Colors.blue[700],
|
||||||
|
/// ),
|
||||||
|
/// ),
|
||||||
|
/// // Solid text as fill.
|
||||||
|
/// Text(
|
||||||
|
/// 'Greetings, planet!',
|
||||||
|
/// style: TextStyle(
|
||||||
|
/// fontSize: 40,
|
||||||
|
/// color: Colors.grey[300],
|
||||||
|
/// ),
|
||||||
|
/// ),
|
||||||
|
/// ],
|
||||||
|
/// )
|
||||||
|
/// ```
|
||||||
|
/// {@end-tool}
|
||||||
|
///
|
||||||
/// ### Custom Fonts
|
/// ### Custom Fonts
|
||||||
///
|
///
|
||||||
/// Custom fonts can be declared in the `pubspec.yaml` file as shown below:
|
/// Custom fonts can be declared in the `pubspec.yaml` file as shown below:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user