Disclosure
A disclosure lets readers open a short detail where they need it. Put enough information in the closed label for them to decide whether to expand it.
Read pickup instructions
#Open Pickup instructions to find the collection point. Close the section and the instructions disappear.
components/disclosure/appliance/read_pickup.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class ReadPickup extends StatelessWidget {
const ReadPickup({super.key});
@override
Widget build(BuildContext context) => ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 440),
child: SingleChildScrollView(
child: const ApplianceDisclosure(
title: 'Pickup instructions',
child: Text('Collect your parcel at the front desk.'),
),
),
);
}
Parameters
ApplianceDisclosure API ↗title- The row's words.
child- What the lid covers.
subtitle- A second line under them.
open- Whether it is open, when you hold it.
onChanged- Called with its new state.
initiallyOpen- Whether it starts open, when it holds its own.
style- The row's style, over ApplianceThemeData.listTileStyle.
Shared behaviour
- Keyboard and focus. Tab to Pickup instructions and activate it again to collapse it.
- Screen readers. Read the trigger, then move forward with it open to reach the instructions. Compare the expanded and collapsed states.
- Direction and type. The instructions use the same direction and text scale as their trigger. Try the phone width with larger type.