Timeline
A timeline puts events in time order. Write down what happened and when, so the sequence makes sense without the connecting line.
Track a parcel
#Read the packing event, then record delivery. A second dated entry appears. Reset the example to return to the first event.
components/timeline/appliance/track_parcel.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class TrackParcel extends StatefulWidget {
const TrackParcel({super.key});
@override
State<TrackParcel> createState() => _TrackParcelState();
}
class _TrackParcelState extends State<TrackParcel> {
bool delivered = false;
@override
Widget build(BuildContext context) => ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 440),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ApplianceTimeline(
entries: [
const ApplianceTimelineEntry(title: 'Packed', time: '10 am'),
if (delivered)
const ApplianceTimelineEntry(title: 'Delivered', time: '2 pm'),
],
),
const SizedBox(height: 12),
ApplianceButton(
delivered ? 'Reset' : 'Record delivery',
onPressed: () => setState(() => delivered = !delivered),
),
],
),
),
);
}
Parameters
ApplianceTimeline API ↗entries- The entries.
style- Overrides the component’s themed appearance for this instance.
Shared behaviour
- Keyboard and focus. Tab to Record delivery and activate it. The dated entries can be read without stopping on each marker.
- Screen readers. Read the time and description for each event, then compare the list after recording delivery.
- Direction and type. The events stay in chronological order in RTL. At larger text sizes, check how each description lines up with its time.