toastify_flutter 2.1.1 copy "toastify_flutter: ^2.1.1" to clipboard
toastify_flutter: ^2.1.1 copied to clipboard

Toast Library for Flutter: Easily create custom toast messages. Add short, customizable notifications to your Flutter apps quickly.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:toastify_flutter/toastify_flutter.dart';

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          title: const Text('Material App Bar'),
        ),
        body: const MyHome(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Center(
      child: FilledButton(
          onPressed: () {
            ToastifyFlutter.error(
              context,
              message: 'This is a custom toast message.',
              duration: 5,
              position: ToastPosition.top,
              // alignment: ToastAlignment.left,
              style: ToastStyle.flat,
              onClose: true,
              animationCurve: Curves.easeOutBack,
            );
          },
          child: const Text('Show toast')),
    );
  }
}
8
likes
160
points
72
downloads

Publisher

unverified uploader

Weekly Downloads

Toast Library for Flutter: Easily create custom toast messages. Add short, customizable notifications to your Flutter apps quickly.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on toastify_flutter