Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1835aac5
Unverified
Commit
1835aac5
authored
Apr 09, 2019
by
Shi-Hao Hong
Committed by
GitHub
Apr 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ListTile sample snippets to use Material Scaffold Template (#30800)
parent
a0182641
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
list_tile.dart
packages/flutter/lib/src/material/list_tile.dart
+29
-29
No files found.
packages/flutter/lib/src/material/list_tile.dart
View file @
1835aac5
...
...
@@ -301,7 +301,7 @@ enum ListTileControlAffinity {
/// 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.
///
/// {@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
/// video list item created with [Expanded] and [Container] widgets.
...
...
@@ -396,35 +396,35 @@ enum ListTileControlAffinity {
///
/// ```dart
/// Widget build(BuildContext context) {
/// return ListView(
/// padding: const EdgeInsets.all(8.0),
/// itemExtent: 106.0,
/// children: <CustomListItem>[
/// CustomListItem(
/// user: 'Flutter',
/// viewCount: 999000,
/// thumbnail: Container(
/// decoration: const BoxDecoration(color: Colors.blue),
/// ),
/// title: 'The Flutter YouTube Channel',
/// ),
/// CustomListItem(
/// user: 'Dash',
/// viewCount: 884000,
/// thumbnail: Container(
/// decoration: const BoxDecoration(color: Colors.yellow),
/// ),
/// title: 'Announcing Flutter 1.0',
/// ),
/// ],
/// );
///
return ListView(
///
padding: const EdgeInsets.all(8.0),
///
itemExtent: 106.0,
///
children: <CustomListItem>[
///
CustomListItem(
///
user: 'Flutter',
///
viewCount: 999000,
///
thumbnail: Container(
///
decoration: const BoxDecoration(color: Colors.blue),
///
),
///
title: 'The Flutter YouTube Channel',
///
),
///
CustomListItem(
///
user: 'Dash',
///
viewCount: 884000,
///
thumbnail: Container(
///
decoration: const BoxDecoration(color: Colors.yellow),
///
),
///
title: 'Announcing Flutter 1.0',
///
),
///
],
///
);
/// }
/// ```
/// {@end-tool}
///
/// {@tool snippet --template=stateless_widget_
material
}
/// {@tool snippet --template=stateless_widget_
scaffold
}
///
/// Here is an
other
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
/// [AspectRatio] widgets to organize its layout.
///
...
...
@@ -453,13 +453,13 @@ enum ListTileControlAffinity {
/// crossAxisAlignment: CrossAxisAlignment.start,
/// children: <Widget>[
/// Expanded(
/// flex:
3
,
/// flex:
2
,
/// child: Column(
/// crossAxisAlignment: CrossAxisAlignment.start,
/// children: <Widget>[
/// Text(
/// '$title',
/// maxLines:
1
,
/// maxLines:
2
,
/// overflow: TextOverflow.ellipsis,
/// style: const TextStyle(
/// fontWeight: FontWeight.bold,
...
...
@@ -468,7 +468,7 @@ enum ListTileControlAffinity {
/// const Padding(padding: EdgeInsets.only(bottom: 2.0)),
/// Text(
/// '$subtitle',
/// maxLines:
3
,
/// maxLines:
2
,
/// overflow: TextOverflow.ellipsis,
/// style: const TextStyle(
/// fontSize: 12.0,
...
...
@@ -479,7 +479,7 @@ enum ListTileControlAffinity {
/// ),
/// ),
/// Expanded(
/// flex:
2
,
/// flex:
1
,
/// child: Column(
/// crossAxisAlignment: CrossAxisAlignment.start,
/// mainAxisAlignment: MainAxisAlignment.end,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment