Skip to content

Toast

Temporary notification popups that appear and disappear automatically.

Installation

bash
flutter_studio add toast
bash
flutter pub add flutter_studio

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