text
stringlengths
1
372
for a list of supported elevation values, see elevation in the
material guidelines.
specifying an unsupported value disables the drop shadow entirely.
<topic_end>
<topic_start>
summary (card)
<topic_end>
<topic_start>
examples (card)
a card containing 3 ListTiles and sized by wrapping
it with a SizedBox. a divider separates the first
and second ListTiles.
app source: card_and_stack
a card containing an image and text.
dart code:
cards_demo.dart
<code_start>
widget _buildCard() {
return SizedBox(
height: 210,
child: card(
child: column(
children: [
ListTile(
title: const text(
'1625 main street',
style: TextStyle(fontWeight: FontWeight.w500),
),
subtitle: const Text('My city, CA 99984'),
leading: icon(
icons.restaurant_menu,
color: colors.blue[500],
),
),
const divider(),
ListTile(
title: const text(
'(408) 555-1212',
style: TextStyle(fontWeight: FontWeight.w500),
),
leading: icon(
icons.contact_phone,
color: colors.blue[500],
),
),
ListTile(
title: const text('costa@example.com'),
leading: icon(
icons.contact_mail,
color: colors.blue[500],
),
),
],
),
),
);
}
<code_end>
<topic_end>
<topic_start>
ListTile
use ListTile, a specialized row widget from the
material library, for an easy way to create a row
containing up to 3 lines of text and optional leading
and trailing icons. ListTile is most commonly used in
card or ListView, but can be used elsewhere.
<topic_end>
<topic_start>
summary (listtile)
<topic_end>
<topic_start>
examples (listtile)
a card containing 3 ListTiles.
app source: card_and_stack
uses ListTile with leading widgets.
dart code:
list_demo.dart
<topic_end>
<topic_start>
constraints
to fully understand flutter’s layout system, you need
to learn how flutter positions and sizes
the components in a layout. for more information,
see understanding constraints.
<topic_end>
<topic_start>
videos
the following videos, part of the
flutter in focus series,
explain stateless and stateful widgets.
flutter in focus playlist
each episode of the
widget of the week series
focuses on a widget. several of them includes layout widgets.
flutter widget of the week playlist
<topic_end>
<topic_start>
other resources
the following resources might help when writing layout code.
<topic_end>