From 8c795e3e07afd348ccf1418b425d1ec23d5d25b4 Mon Sep 17 00:00:00 2001 From: Pragya Date: Tue, 11 Aug 2020 22:36:03 +0530 Subject: [PATCH] Updated Row API doc for RTL in textDirection (#61323) --- packages/flutter/lib/src/widgets/basic.dart | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 55b0d743ac..4810ac6ace 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -3951,6 +3951,11 @@ class Flex extends MultiChildRenderObjectWidget { /// /// Defaults to the ambient [Directionality]. /// + /// If [textDirection] is [TextDirection.rtl], then the direction in which + /// text flows starts from right to left. Otherwise, if [textDirection] is + /// [TextDirection.ltr], then the direction in which text flows starts from + /// left to right. + /// /// If the [direction] is [Axis.horizontal], this controls the order in which /// the children are positioned (left-to-right or right-to-left), and the /// meaning of the [mainAxisAlignment] property's [MainAxisAlignment.start] and @@ -4184,6 +4189,28 @@ class Flex extends MultiChildRenderObjectWidget { /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/widgets/row_fixed.png) /// +/// The [textDirection] property controls the direction that children are rendered in. +/// [TextDirection.ltr] is the default [textDirection] of [Row] children, so the first +/// child is rendered at the `start` of the [Row], to the left, with subsequent children +/// following to the right. If you want to order children in the opposite +/// direction (right to left), then [textDirection] can be set to +/// [TextDirection.rtl]. This is shown in the example below +/// +/// ```dart +/// Row( +/// textDirection: TextDirection.rtl, +/// children: [ +/// const FlutterLogo(), +/// const Expanded( +/// child: Text("Flutter's hot reload helps you quickly and easily experiment, build UIs, add features, and fix bug faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android."), +/// ), +/// const Icon(Icons.sentiment_very_satisfied), +/// ], +/// ) +/// ``` +/// +/// ![](https://flutter.github.io/assets-for-api-docs/assets/widgets/row_textDirection.png) +/// /// ## Layout algorithm /// /// _This section describes how a [Row] is rendered by the framework._