From fd80503fd33ae2552763a85328a5dba8e8e9e0c5 Mon Sep 17 00:00:00 2001 From: Ayush Bherwani Date: Fri, 10 Jul 2020 14:41:02 +0530 Subject: [PATCH] [Api docs] Updates ListTile.subtitle docs to address how TextStyle is decided (#61071) --- packages/flutter/lib/src/material/list_tile.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 28b75cbbed..113411be92 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -687,6 +687,21 @@ class ListTile extends StatelessWidget { /// If [isThreeLine] is true, this should be configured to take a maximum of /// two lines. For example, you can use [Text.maxLines] to enforce the number /// of lines. + /// + /// The subtitle's default [TextStyle] depends on [TextTheme.bodyText2] except + /// [TextStyle.color]. The [TextStyle.color] depends on the value of [enabled] + /// and [selected]. + /// + /// When [enabled] is false, the text color is set to [ThemeData.disabledColor]. + /// + /// When [selected] is true, the text color is set to [ListTileTheme.selectedColor] + /// if it's not null. If [ListTileTheme.selectedColor] is null, the text color + /// is set to [ThemeData.primaryColor] when [ThemeData.brightness] is + /// [Brightness.light] and to [ThemeData.accentColor] when it is [Brightness.dark]. + /// + /// When [selected] is false, the text color is set to [ListTileTheme.textColor] + /// if it's not null and to [TextTheme.caption]'s color if [ListTileTheme.textColor] + /// is null. final Widget subtitle; /// A widget to display after the title.