@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for custom list items.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for custom list items.
|
||||
|
||||
void main() => runApp(const CustomListItemApp());
|
||||
|
||||
class CustomListItemApp extends StatelessWidget {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for custom list items.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for custom list items.
|
||||
|
||||
void main() => runApp(const CustomListItemApp());
|
||||
|
||||
class CustomListItemApp extends StatelessWidget {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [ListTile].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [ListTile].
|
||||
|
||||
void main() => runApp(const ListTileApp());
|
||||
|
||||
class ListTileApp extends StatelessWidget {
|
||||
@@ -86,8 +86,9 @@ class _LisTileExampleState extends State<LisTileExample> with TickerProviderStat
|
||||
subtitle: const Text('Tap here for Hero transition'),
|
||||
tileColor: Colors.cyan,
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute<Widget>(
|
||||
builder: (BuildContext context) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute<Widget>(builder: (BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('ListTile Hero')),
|
||||
body: Center(
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [ListTile].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [ListTile].
|
||||
|
||||
void main() => runApp(const ListTileApp());
|
||||
|
||||
class ListTileApp extends StatelessWidget {
|
||||
@@ -67,9 +67,7 @@ class LisTileExample extends StatelessWidget {
|
||||
child: ListTile(
|
||||
leading: FlutterLogo(size: 72.0),
|
||||
title: Text('Three-line ListTile'),
|
||||
subtitle: Text(
|
||||
'A sufficiently long subtitle warrants three lines.'
|
||||
),
|
||||
subtitle: Text('A sufficiently long subtitle warrants three lines.'),
|
||||
trailing: Icon(Icons.more_vert),
|
||||
isThreeLine: true,
|
||||
),
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [ListTile].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [ListTile].
|
||||
|
||||
void main() => runApp(const ListTileApp());
|
||||
|
||||
class ListTileApp extends StatelessWidget {
|
||||
@@ -30,29 +30,25 @@ class ListTileExample extends StatelessWidget {
|
||||
body: ListView(
|
||||
children: const <Widget>[
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
child: Text('A')
|
||||
),
|
||||
leading: CircleAvatar(child: Text('A')),
|
||||
title: Text('Headline'),
|
||||
subtitle: Text('Supporting text'),
|
||||
trailing: Icon(Icons.favorite_rounded),
|
||||
),
|
||||
Divider(height: 0),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
child: Text('B')
|
||||
),
|
||||
leading: CircleAvatar(child: Text('B')),
|
||||
title: Text('Headline'),
|
||||
subtitle: Text('Longer supporting text to demonstrate how the text wraps and how the leading and trailing widgets are centered vertically with the text.'),
|
||||
subtitle: Text(
|
||||
'Longer supporting text to demonstrate how the text wraps and how the leading and trailing widgets are centered vertically with the text.'),
|
||||
trailing: Icon(Icons.favorite_rounded),
|
||||
),
|
||||
Divider(height: 0),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
child: Text('C')
|
||||
),
|
||||
leading: CircleAvatar(child: Text('C')),
|
||||
title: Text('Headline'),
|
||||
subtitle: Text("Longer supporting text to demonstrate how the text wraps and how setting 'ListTile.isThreeLine = true' aligns leading and trailing widgets to the top vertically with the text."),
|
||||
subtitle: Text(
|
||||
"Longer supporting text to demonstrate how the text wraps and how setting 'ListTile.isThreeLine = true' aligns leading and trailing widgets to the top vertically with the text."),
|
||||
trailing: Icon(Icons.favorite_rounded),
|
||||
isThreeLine: true,
|
||||
),
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [ListTile].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [ListTile].
|
||||
|
||||
void main() => runApp(const ListTileApp());
|
||||
|
||||
class ListTileApp extends StatelessWidget {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [ListTile].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [ListTile].
|
||||
|
||||
void main() => runApp(const ListTileApp());
|
||||
|
||||
class ListTileApp extends StatelessWidget {
|
||||
@@ -41,10 +41,11 @@ class _ListTileExampleState extends State<ListTileExample> {
|
||||
titleAlignment: titleAlignment,
|
||||
leading: Checkbox(
|
||||
value: true,
|
||||
onChanged:(bool? value) { },
|
||||
onChanged: (bool? value) {},
|
||||
),
|
||||
title: const Text('Headline Text'),
|
||||
subtitle: const Text('Tapping on the trailing widget will show a menu that allows you to change the title alignment. The title alignment is set to threeLine by default if `ThemeData.useMaterial3` is true. Otherwise, defaults to titleHeight.'),
|
||||
subtitle: const Text(
|
||||
'Tapping on the trailing widget will show a menu that allows you to change the title alignment. The title alignment is set to threeLine by default if `ThemeData.useMaterial3` is true. Otherwise, defaults to titleHeight.'),
|
||||
trailing: PopupMenuButton<ListTileTitleAlignment>(
|
||||
onSelected: (ListTileTitleAlignment? value) {
|
||||
setState(() {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [ListTile.selected].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [ListTile.selected].
|
||||
|
||||
void main() => runApp(const ListTileApp());
|
||||
|
||||
class ListTileApp extends StatelessWidget {
|
||||
@@ -19,6 +19,7 @@ class ListTileApp extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class LisTileExample extends StatefulWidget {
|
||||
const LisTileExample({super.key});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user