Skip to content
Get started
Menu
Get started

State message

StateMessage replaces a list when there is nothing to show: no items yet, nothing matches a search, or the list failed to load. It is compact and left-aligned, so it reads as part of the list it replaces rather than as an illustration.

Empty transaction, spending failure, transaction failure and no-match messages with recovery actions.Empty transaction, spending failure, transaction failure and no-match messages with recovery actions.
Light and dark variants
Empty transaction, spending failure, transaction failure and no-match messages with recovery actions at 200 percent text. Part 1 of 2.Continued: Empty transaction, spending failure, transaction failure and no-match messages with recovery actions at 200 percent text. Part 2 of 2.
200% text Shown in 2 images, top to bottom; each repeats the last few lines of the one before.

Add the published package, then paste this complete example into lib/main.dart.

import 'package:flutter/material.dart';
import 'package:rakit_ui/rakit_ui.dart';
void main() => runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Example')),
body: Builder(builder: (context) => Padding(
padding: const EdgeInsets.all(16),
child: const StateMessage(
icon: Icons.note_outlined,
title: 'No notes yet',
message: 'Notes you create will appear here.',
),
)),
),
));

Variants: neutral, info, success, warning, danger.

Nothing exists yet. Say what will appear here and how to get it.

const StateMessage(
icon: Icons.bookmark_border,
title: 'No saved billers',
message: 'Save a biller after paying to find it here.',
);

The list has items but none match the search or filter. Offer to clear the filter rather than a retry. TransactionHistory shows this state on its own.

Loading failed. Use tone: StatusTone.danger: the message is then announced to screen readers when it appears. Offer one way forward, usually “Try again”.

The action is a secondary button that hugs its label, inside the text column. It is never stretched across a module. The message uses the body size for the current text scale, like a banner’s.

A required title explains missing module content; message adds context and actionLabel/onAction provide recovery. DataTable and detail modules use it for empty results. Do not replace it with an unlabelled icon.

Situation Variant / composition Payment example
No transactions or failed history neutral Explain why content is empty and offer recovery; danger is for primary-content failure.

Use Banner when surrounding content remains useful.

Distinguish no items, no matches and failed loading. The recovery action should address that state, such as clearing filters or retrying the request.

Do: Explain why content is empty and offer recovery; danger is for primary-content failure.

Don’t: Show only No data without context or an available next action.

  • The title says what happened: “No saved billers”, “No payments match ‘pulsa’”, “Couldn’t load billers”.
  • The message is one line on why or what to do next.
  • One action at most. If there is nothing the person can do, leave it out.
  • The headline carries the meaning, so the icon stays muted in every tone.
  • The message is one semantics container.
  • tone: StatusTone.danger makes it a live region, so errors are announced. Other tones are read in place.
Example history screen with synthetic dataExample history screen with synthetic data
Example: history

StateMessage

class StateMessage extends StatelessWidget · lib/src/interaction/interaction.dart

Empty, error and "nothing matches" states: what happened, one line on why, and at most one way forward. Compact and left-aligned, so it reads as part of the list it replaces rather than as an illustration. Padded by group (16) above and below.

ParameterTypeDefaultDescription
icon:requiredIconData——
title:requiredString——
message:String?——
tone:StatusToneStatusTone.neutralStatusTone.danger announces the message when it appears. The headline carries the meaning, so the icon stays muted in every tone.
actionLabel:String?——
onAction:FutureOr<void> Function()?——

PaymentEmptyMessage

class PaymentEmptyMessage · lib/src/content/empty_message.dart

Empty-state explanation and an optional next action.

ParameterTypeDefaultDescription
titlerequiredpositionalString—What is empty.
message:String?—Why it is empty.
actionLabel:String?—Next action label.
onAction:VoidCallback?—Host action, supplied together with its label.
icon:IconDataIcons.inbox_outlinedSupporting visual cue.

Use Data table for settlement selection, actions and paging. Empty tables accept a host explanation and next action.