Skip to content

Toast ​

Temporary notification popups that appear and disappear automatically.

Installation ​

bash
bricolage_ui add toast
bash
flutter pub add bricolage_ui

Usage ​

dart
CustomToast.show(
  context,
  message: 'File saved successfully',
  type: ToastType.success,
)

Toast Types ​

dart
// Success toast
CustomToast.show(
  context,
  message: 'Success!',
  type: ToastType.success,
)

// Error toast
CustomToast.show(
  context,
  message: 'Error occurred',
  type: ToastType.error,
)

// Info toast
CustomToast.show(
  context,
  message: 'Did you know?',
  type: ToastType.info,
)

API Reference ​

Properties ​

PropertyTypeDefaultDescription
messageStringrequiredToast message
typeToastTypeinfoToast type
durationDuration3sDisplay duration