Status view
A status view explains what happened to a whole region of a page. When the reader can recover, put an action beside the explanation.
Retry a file list
#The file list could not load. Retry to see the recovered item, then reset the example to return to the error.
components/status-view/appliance/retry_file_list.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class RetryFileList extends StatefulWidget {
const RetryFileList({super.key});
@override
State<RetryFileList> createState() => _RetryFileListState();
}
class _RetryFileListState extends State<RetryFileList> {
bool failed = true;
@override
Widget build(BuildContext context) => ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 380),
child: failed
? ApplianceStatusView(
status: ApplianceStatus.error,
title: 'Files unavailable',
message: 'The connection was interrupted.',
actions: [
ApplianceButton(
'Retry',
onPressed: () => setState(() => failed = false),
),
],
)
: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text('Planning notes'),
const SizedBox(height: 12),
ApplianceButton(
'Reset example',
onPressed: () => setState(() => failed = true),
),
],
),
);
}
Parameters
ApplianceStatusView API ↗title- Heading that describes the failure.
status- Chooses the error presentation.
actions- Controls offered below the explanation.
Shared behaviour
- Keyboard and focus. Tab to the retry action and activate it. The recovered list includes a reset action.
- Screen readers. Read the failure heading, the reason and the retry action in order. After retrying, read the item that replaced them.
- Direction and type. The message follows reading direction and can occupy more lines at larger text sizes.