flashy_flushbar 1.4.0 copy "flashy_flushbar: ^1.4.0" to clipboard
flashy_flushbar: ^1.4.0 copied to clipboard

A highly customizable, dismissible, and animated flushbar (toast) for Flutter applications.

example/main.dart

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

void main() {
  runApp(
    const MyApp(),
  );
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: FlashyFlushbarProvider.init(),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flashy Flushbar Example'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              // Show a simple FlashyFlushbar
              FlashyFlushbar(
                leadingWidget: const Icon(
                  Icons.error_outline,
                  color: Colors.black,
                  size: 24,
                ),
                message: 'Hello, Flashy Flushbar!',
                duration: const Duration(seconds: 3),
                backgroundColor: Colors.green,
                trailingWidget: IconButton(
                  icon: const Icon(
                    Icons.close,
                    color: Colors.black,
                    size: 24,
                  ),
                  onPressed: () {
                    FlashyFlushbar.cancel();
                  },
                ),
                boxShadows: const [
                  BoxShadow(
                      color: Colors.blue, blurRadius: 4.0, spreadRadius: 2.0),
                ],
              ).show();

              // Show undismissible FlashyFlushbar
              FlashyFlushbar(
                message: 'You can dismiss this!',
                duration: const Duration(seconds: 3),
                dismissDirection: DismissDirection.horizontal,
                isDismissible: false,
              ).show();

              // Cancel the last displayed Flushbar
              Future.delayed(const Duration(seconds: 2), () {
                FlashyFlushbar.cancel();
              });
            },
            child: const Text('Show Flashy Flushbar'),
          ),
        ),
      ),
    );
  }
}
8
likes
150
pub points
79%
popularity

Publisher

unverified uploader

A highly customizable, dismissible, and animated flushbar (toast) for Flutter applications.

Repository (GitHub)
View/report issues

Topics

#flutter-toast #flutter-snackbar #flutter-flushbar #custom-flutter-snackbar #custom-flutter-toast

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flashy_flushbar