List row
Use a list row for one item in a collection. A short title identifies the item and a second line can carry its status.
Read a message
#Activate the message row to mark it read. Activate it again to return it to Unread.
components/list-row/appliance/read_message.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class ReadMessage extends StatefulWidget {
const ReadMessage({super.key});
@override
State<ReadMessage> createState() => _ReadMessageState();
}
class _ReadMessageState extends State<ReadMessage> {
bool read = false;
@override
Widget build(BuildContext context) => ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 440),
child: ApplianceListTile(
title: 'Route change',
subtitle: read ? 'Read' : 'Unread',
onTap: () => setState(() => read = !read),
),
);
}
Parameters
ApplianceListTile API ↗title- The row's words.
subtitle- A supporting line under the title.
leading- A glyph at the start, 20 px.
trailing- A control at the end (a switch, a checkbox).
trailingText- A value at the end, muted.
onTap- Runs when the reader activates the component. Leave it unset for a read-only item.
selected- Whether the row is latched down as the current choice.
showChevron- Controls the directional indicator at the end of the row.
destructive- Applies the destructive treatment to the row.
enabled- Whether it can be pressed.
semanticLabel- The row's name for a screen reader, in place of its words.
style- Its style, over ApplianceThemeData.listTileStyle.
Shared behaviour
- Keyboard and focus. Tab to the row and activate it. The entire row handles the action.
- Screen readers. Read the message title and its current status before and after activation.
- Direction and type. The title and status share a leading edge. Compare their positions in LTR and RTL at larger type.