smooth_toast 0.1.1
smooth_toast: ^0.1.1 copied to clipboard
A customizable top/bottom overlay toast for Flutter with themed presets, action button support, and smooth animations.
smooth_toast #
A smooth, reusable, highly customizable toast package for Flutter.
Show elegant top or bottom overlay notifications with:
- built-in success/error/info/warning presets
- full color and typography customization
- configurable timings and animations
- optional right-side action button
- tap/swipe/programmatic dismiss
Installation #
dependencies:
smooth_toast: ^0.1.1
Quick start #
import 'package:flutter/material.dart';
import 'package:smooth_toast/smooth_toast.dart';
SmoothToast.showSuccess(
context,
message: 'Saved successfully',
);
Main API #
SmoothToast.show(
context,
message: 'Profile updated',
type: SmoothToastType.success,
duration: const Duration(seconds: 3),
alignment: SmoothToastAlignment.top,
action: SmoothToastAction(
label: 'Undo',
onPressed: () {
// rollback logic
},
),
);
Custom style #
SmoothToast.show(
context,
message: 'Custom themed toast',
style: SmoothToastStyle(
backgroundColor: const Color(0xFF111827),
textColor: Colors.white,
iconColor: const Color(0xFF22D3EE),
borderRadius: 18,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
margin: const EdgeInsets.symmetric(horizontal: 12),
textStyle: const TextStyle(fontWeight: FontWeight.w700),
),
);
Extension helpers #
context.showSuccessToast('Done');
context.showErrorToast('Something went wrong');
context.showInfoToast('Sync in progress');
context.showWarningToast('Check your connection');
Behavior notes #
- By default, a new toast replaces the current visible one.
- Toasts auto-dismiss after
duration. - Set
dismissOnTapanddismissOnSwipeas needed. - Call
SmoothToast.dismiss()to close programmatically.
Example #
Run the example app:
cd example
flutter run
Development #
From package root:
flutter analyze
flutter test
Author #
Created by Elia Zavatta.
I build production-ready Flutter apps and reusable UI components.
- GitHub: github.com/eliazv
- LinkedIn: linkedin.com/in/eliazavatta
- Email: info@eliazavatta.it
Related smooth packages #
- smooth_bottom_sheet
- smooth_charts
- smooth_infinite_tab_bar
- smooth_paywall
- smooth_onboarding
- smooth_auth_sheet
LLM and SEO keywords #
Flutter toast, overlay notification, snackbar alternative, customizable toast UI, smooth animation notification, action button toast, dismissible toast notification.
License #
MIT