my_toastify 0.0.1 copy "my_toastify: ^0.0.1" to clipboard
my_toastify: ^0.0.1 copied to clipboard

A customizable toast notification system for Flutter. Supports banners, snackbars, and advanced styling.

Toastify #

pub package   GitHub stars   GitHub license   Buy Me A Coffee

A beautiful, customizable toast notification system for Flutter.
Supports banners, snackbars, custom icons, actions, and multiple stacking positions.


đŸ–ŧī¸ Demo Preview #

[Toastify Demo]


🚀 Features #

  • Overlay-based toast notifications
  • Top or bottom stacking
  • Two styles: snackBarStyle & bannerStyle
  • Custom icons, actions, and colors
  • Auto-dismiss with animation
  • Multiple toasts at once
  • Swipe-to-dismiss gesture

đŸ“Ļ Installation #

flutter pub add toastify

🧠 API Reference #

ToastDetails #

Property Type Default Description
message String — Message text displayed in toast
title String? null Optional title above message
type ToastType ToastType.info Defines color/icon scheme
position ToastPosition ToastPosition.bottom Where toast appears
style ToastStyle ToastStyle.snackBarStyle Toast UI layout
titleTextStyle TextStyle? Theme.of(context).textTheme.titleMedium!.copyWith(color: Colors.white) Custom title style
messageTextStyle TextStyle? Theme.of(context).textTheme.bodyMedium!.copyWith(color: Colors.white) Custom message style
leading Widget? null Optional icon widget
action Widget? null Optional action button
backgroundColor Color? null Override default color
borderColor Color? null Adds custom border
boxShadow List<BoxShadow>? null Shadow customization
duration Duration 3 seconds Auto dismiss time

💡 Example Usage #

import 'package:flutter/material.dart';
import 'package:toastify/my_toastify.dart';

void main() {
  runApp(const ToastifyDemo());
}

class ToastifyDemo extends StatelessWidget {
  const ToastifyDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Toastify Example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              Toastify.show(
                context: context,
                title: 'Success',
                message: 'Profile updated successfully!',
                type: ToastType.success,
                position: ToastPosition.top,
                style: ToastStyle.bannerStyle,
              );
            },
            child: const Text('Show Toast'),
          ),
        ),
      ),
    );
  }
}

âš™ī¸ Advanced Usage Examples #

✅ With Leading Icon #

Toastify.show(
  context: context,
  title: 'Upload Complete',
  message: 'Your photo has been uploaded successfully.',
  type: ToastType.success,
  position: ToastPosition.bottom,
  style: ToastStyle.snackBarStyle,
  leading: const Icon(Icons.check_circle, color: Colors.white),
);

đŸŒĢī¸ With Shadow #

Toastify.show(
  context: context,
  title: 'File Saved',
  message: 'Document saved to local storage.',
  type: ToastType.success,
  position: ToastPosition.bottom,
  style: ToastStyle.snackBarStyle,
  boxShadow: [
    BoxShadow(
      color: Colors.black.withOpacity(0.3),
      blurRadius: 10,
      offset: const Offset(0, 4),
    ),
  ],
);

đŸĒ„ With Action Button #

Toastify.show(
  context: context,
  title: 'Undo Action',
  message: 'File deleted successfully.',
  type: ToastType.success,
  position: ToastPosition.bottom,
  style: ToastStyle.snackBarStyle,
  action: TextButton(
    onPressed: () {
      debugPrint('Undo pressed');
    },
    child: const Text('Undo', style: TextStyle(color: Colors.white)),
  ),
);

đŸ’Ŧ Without Title #

Toastify.show(
  context: context,
  message: 'Settings have been updated.',
  type: ToastType.info,
  position: ToastPosition.bottom,
  style: ToastStyle.snackBarStyle,
);

â¤ī¸ Author #

Created by Thant Zin

Copyright (ÂŠī¸) 2025 Thant Zin

7
likes
0
points
13
downloads

Publisher

verified publisherdevthantzin.com

Weekly Downloads

A customizable toast notification system for Flutter. Supports banners, snackbars, and advanced styling.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on my_toastify