diff --git a/examples/api/lib/material/list_tile/custom_list_item.1.dart b/examples/api/lib/material/list_tile/custom_list_item.1.dart index d04b2614a0..7cc63e1070 100644 --- a/examples/api/lib/material/list_tile/custom_list_item.1.dart +++ b/examples/api/lib/material/list_tile/custom_list_item.1.dart @@ -13,8 +13,9 @@ class CustomListItemApp extends StatelessWidget { @override Widget build(BuildContext context) { - return const MaterialApp( - home: CustomListItemExample(), + return MaterialApp( + theme: ThemeData(useMaterial3: true), + home: const CustomListItemExample(), ); } } @@ -39,51 +40,38 @@ class _ArticleDescription extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - const Padding(padding: EdgeInsets.only(bottom: 2.0)), - Text( - subtitle, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: const TextStyle( - fontSize: 12.0, - color: Colors.black54, - ), - ), - ], + Text( + title, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontWeight: FontWeight.bold, ), ), + const Padding(padding: EdgeInsets.only(bottom: 2.0)), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - author, - style: const TextStyle( - fontSize: 12.0, - color: Colors.black87, - ), - ), - Text( - '$publishDate - $readDuration', - style: const TextStyle( - fontSize: 12.0, - color: Colors.black54, - ), - ), - ], + child: Text( + subtitle, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 12.0, + color: Colors.black54, + ), + ), + ), + Text( + author, + style: const TextStyle( + fontSize: 12.0, + color: Colors.black87, + ), + ), + Text( + '$publishDate - $readDuration', + style: const TextStyle( + fontSize: 12.0, + color: Colors.black54, ), ), ], diff --git a/examples/api/test/material/list_tile/custom_list_item.1_test.dart b/examples/api/test/material/list_tile/custom_list_item.1_test.dart index 0002d0125d..862350b60c 100644 --- a/examples/api/test/material/list_tile/custom_list_item.1_test.dart +++ b/examples/api/test/material/list_tile/custom_list_item.1_test.dart @@ -20,7 +20,7 @@ void main() { expect(thumbnailAspectRatio.aspectRatio, 1.0); // The Expanded widget is used to control the size of the text. - Expanded textExpanded = tester.widget(find.ancestor( + final Expanded textExpanded = tester.widget(find.ancestor( of: find.text('Flutter 1.0 Launch'), matching: find.byType(Expanded).at(0), )); @@ -32,12 +32,5 @@ void main() { matching: find.byType(AspectRatio), )); expect(thumbnailAspectRatio.aspectRatio, 1.0); - - // The Expanded widget is used to control the size of the text. - textExpanded = tester.widget(find.ancestor( - of: find.text('Flutter 1.2 Release - Continual updates to the framework'), - matching: find.byType(Expanded).at(3), - )); - expect(textExpanded.flex, 1); }); } diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index e96ea52819..6c5205d489 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -296,8 +296,6 @@ enum ListTileTitleAlignment { /// Here is an example of a custom list item that resembles a YouTube-related /// video list item created with [Expanded] and [Container] widgets. /// -/// ![Custom list item a](https://flutter.github.io/assets-for-api-docs/assets/widgets/custom_list_item_a.png) -/// /// ** See code in examples/api/lib/material/list_tile/custom_list_item.0.dart ** /// {@end-tool} /// @@ -306,8 +304,6 @@ enum ListTileTitleAlignment { /// subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and /// [AspectRatio] widgets to organize its layout. /// -/// ![Custom list item b](https://flutter.github.io/assets-for-api-docs/assets/widgets/custom_list_item_b.png) -/// /// ** See code in examples/api/lib/material/list_tile/custom_list_item.1.dart ** /// {@end-tool} ///