Loading...
Loading...
Show toasts with ShadToaster.of(context).show(ShadToast); title, description, action, ShadToast.destructive. Use when displaying temporary messages or feedback in a Flutter shadcn_ui app.
npx skill4agent add serverpod/skills-registry shadcn_ui-toastShadToasterShadToaster.of(context)toaster.show(ShadToast(...))toaster.hide()ShadToasttitledescriptionactionShadToast.destructiveShadDecorationShadToaster.of(context).show(
const ShadToast(
description: Text('Your message has been sent.'),
),
);ShadToaster.of(context).show(
const ShadToast(
title: Text('Uh oh! Something went wrong'),
description: Text('There was a problem with your request'),
),
);ShadToaster.of(context).show(
ShadToast(
title: const Text('Uh oh! Something went wrong'),
description: const Text('There was a problem with your request'),
action: ShadButton.outline(
child: const Text('Try again'),
onPressed: () => ShadToaster.of(context).hide(),
),
),
);final theme = ShadTheme.of(context);
ShadToaster.of(context).show(
ShadToast.destructive(
title: const Text('Uh oh! Something went wrong'),
description: const Text('There was a problem with your request'),
action: ShadButton.destructive(
child: const Text('Try again'),
decoration: ShadDecoration(
border: ShadBorder.all(
color: theme.colorScheme.destructiveForeground,
width: 1,
),
),
onPressed: () => ShadToaster.of(context).hide(),
),
),
);