| j / k | Scroll down / up |
| gg | Scroll to top |
| G | Scroll to bottom |
| ⌘K / / | Open search |
| ? | Show this help |
| Esc | Close search / help |
| n / N | Next / previous section |
| h | Go to landing |
| d | Go to docs |
| : | Command mode — type section name |
Press ? or Esc to close
Toasts are a global overlay driven by ToastCubit, a singleton. Any layer can push a toast; the UI renders them in one place at the app root.
sl<ToastCubit>().show(
message: context.l10n.t(TranslationKeys.commonSaved),
type: ToastType.success,
); The cubit holds a list of active toasts, each with a type, message, and auto-dismiss timer. ToastOverlay animates them in and out.
enum ToastType { info, success, warning, error }
class ToastCubit extends Cubit<ToastState> {
void show({required String message, ToastType type = ToastType.info}) {
final item = ToastItem(id: _uuid(), message: message, type: type);
emit(state.add(item));
Future.delayed(const Duration(seconds: 3), () => dismiss(item.id));
}
void dismiss(String id) => emit(state.remove(id));
} ToastOverlay is mounted once in app.dart, above the shell. It positions toasts (top or bottom) and fades them.
BlocBuilder<ToastCubit, ToastState>(
builder: (context, state) => Stack(
children: state.items.map((t) => _ToastCard(item: t)).toList(),
),
) | Toast | GlobalErrorCubit | |
|---|---|---|
| Trigger | Any layer, explicitly | ErrorInterceptor automatically |
| Use for | "Saved", "Copied" | Network / server failures |
| Dedupe | No | Yes, by error code |