flashy_flushbar 0.0.1 copy "flashy_flushbar: ^0.0.1" to clipboard
flashy_flushbar: ^0.0.1 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 FlashyFlushbarProvider(
      child: MyApp(),
    ),
  );
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      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
              const FlashyFlushbar(
                message: 'You can dismiss this!',
                duration: 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
140
pub points
79%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flashy_flushbar