Unverified Commit 1835aac5 authored by Shi-Hao Hong's avatar Shi-Hao Hong Committed by GitHub

Update ListTile sample snippets to use Material Scaffold Template (#30800)

parent a0182641
...@@ -301,7 +301,7 @@ enum ListTileControlAffinity { ...@@ -301,7 +301,7 @@ enum ListTileControlAffinity {
/// you're looking for, it's easy to create custom list items with a /// you're looking for, it's easy to create custom list items with a
/// combination of other widgets, such as [Row]s and [Column]s. /// combination of other widgets, such as [Row]s and [Column]s.
/// ///
/// {@tool snippet --template=stateless_widget_material} /// {@tool snippet --template=stateless_widget_scaffold}
/// ///
/// Here is an example of a custom list item that resembles a Youtube related /// Here is an example of a custom list item that resembles a Youtube related
/// video list item created with [Expanded] and [Container] widgets. /// video list item created with [Expanded] and [Container] widgets.
...@@ -396,35 +396,35 @@ enum ListTileControlAffinity { ...@@ -396,35 +396,35 @@ enum ListTileControlAffinity {
/// ///
/// ```dart /// ```dart
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return ListView( /// return ListView(
/// padding: const EdgeInsets.all(8.0), /// padding: const EdgeInsets.all(8.0),
/// itemExtent: 106.0, /// itemExtent: 106.0,
/// children: <CustomListItem>[ /// children: <CustomListItem>[
/// CustomListItem( /// CustomListItem(
/// user: 'Flutter', /// user: 'Flutter',
/// viewCount: 999000, /// viewCount: 999000,
/// thumbnail: Container( /// thumbnail: Container(
/// decoration: const BoxDecoration(color: Colors.blue), /// decoration: const BoxDecoration(color: Colors.blue),
/// ), /// ),
/// title: 'The Flutter YouTube Channel', /// title: 'The Flutter YouTube Channel',
/// ), /// ),
/// CustomListItem( /// CustomListItem(
/// user: 'Dash', /// user: 'Dash',
/// viewCount: 884000, /// viewCount: 884000,
/// thumbnail: Container( /// thumbnail: Container(
/// decoration: const BoxDecoration(color: Colors.yellow), /// decoration: const BoxDecoration(color: Colors.yellow),
/// ), /// ),
/// title: 'Announcing Flutter 1.0', /// title: 'Announcing Flutter 1.0',
/// ), /// ),
/// ], /// ],
/// ); /// );
/// } /// }
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
/// ///
/// {@tool snippet --template=stateless_widget_material} /// {@tool snippet --template=stateless_widget_scaffold}
/// ///
/// Here is another example of an article list item with multi-line titles and /// Here is an example of an article list item with multi-line titles and
/// subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and /// subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and
/// [AspectRatio] widgets to organize its layout. /// [AspectRatio] widgets to organize its layout.
/// ///
...@@ -453,13 +453,13 @@ enum ListTileControlAffinity { ...@@ -453,13 +453,13 @@ enum ListTileControlAffinity {
/// crossAxisAlignment: CrossAxisAlignment.start, /// crossAxisAlignment: CrossAxisAlignment.start,
/// children: <Widget>[ /// children: <Widget>[
/// Expanded( /// Expanded(
/// flex: 3, /// flex: 2,
/// child: Column( /// child: Column(
/// crossAxisAlignment: CrossAxisAlignment.start, /// crossAxisAlignment: CrossAxisAlignment.start,
/// children: <Widget>[ /// children: <Widget>[
/// Text( /// Text(
/// '$title', /// '$title',
/// maxLines: 1, /// maxLines: 2,
/// overflow: TextOverflow.ellipsis, /// overflow: TextOverflow.ellipsis,
/// style: const TextStyle( /// style: const TextStyle(
/// fontWeight: FontWeight.bold, /// fontWeight: FontWeight.bold,
...@@ -468,7 +468,7 @@ enum ListTileControlAffinity { ...@@ -468,7 +468,7 @@ enum ListTileControlAffinity {
/// const Padding(padding: EdgeInsets.only(bottom: 2.0)), /// const Padding(padding: EdgeInsets.only(bottom: 2.0)),
/// Text( /// Text(
/// '$subtitle', /// '$subtitle',
/// maxLines: 3, /// maxLines: 2,
/// overflow: TextOverflow.ellipsis, /// overflow: TextOverflow.ellipsis,
/// style: const TextStyle( /// style: const TextStyle(
/// fontSize: 12.0, /// fontSize: 12.0,
...@@ -479,7 +479,7 @@ enum ListTileControlAffinity { ...@@ -479,7 +479,7 @@ enum ListTileControlAffinity {
/// ), /// ),
/// ), /// ),
/// Expanded( /// Expanded(
/// flex: 2, /// flex: 1,
/// child: Column( /// child: Column(
/// crossAxisAlignment: CrossAxisAlignment.start, /// crossAxisAlignment: CrossAxisAlignment.start,
/// mainAxisAlignment: MainAxisAlignment.end, /// mainAxisAlignment: MainAxisAlignment.end,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment