๐Ÿงณ Animated Snackbars

A Flutter package to display beautiful, animated snackbars with directional slide-in/out transitions. Includes preset styles for success, error, info, and warning messages โ€” plus full customization options.


โœจ Features

Feature Description
๐Ÿ”„ Animated Smooth slide-in/out animation
โ†•๏ธ Directional Slides in from bottom
โœ… Presets showSuccessSnackbar, showErrorSnackbar, etc.
๐ŸŽจ Customizable Control color, icon, duration, message, and description
๐Ÿšซ Single Instance Only one snackbar visible at a time
โŒจ๏ธ Keyboard Aware Snackbar appears above keyboard & respects safe area

Example Images


๐Ÿ› ๏ธ Installation

Add dependencies in pubspec.yaml:

dependencies:
  animated_snackbars: ^<latest_version>

Then run:

flutter pub get

๐Ÿ—ฐ Import

import 'package:animated_snackbars/animated_snackbars.dart';

๐Ÿš€ Usage

๐Ÿงช Basic Example

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Animated Snackbars Example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              SnackbarUtils.showAnimatedSnackbar(
                context: context,
                message: 'Hello, this is a snackbar!',
                description: 'This is a more detailed message.',
              );
            },
            child: const Text('Show Snackbar'),
          ),
        ),
      ),
    );
  }
}

๐Ÿ“† Preset Snackbars

SnackbarUtils.showErrorSnackbar(
    context: context,
    message: 'Success!',
    description: 'The operation was completed successfully.',
);

SnackbarUtils.showErrorSnackbar(
    context: context,
    message: 'Oops!',
    description: 'Something went wrong.',
);

SnackbarUtils.showInfoSnackbar(
    context: context,
    message: 'Heads up!',
    description: 'Here is some important information.',
);

SnackbarUtils.showWarningSnackbar(
    context: context,
    message: 'Warning!',
    description: 'Please be careful.',
);

๐Ÿ› ๏ธ Custom Snackbar

SnackbarUtils.showAnimatedSnackbar(
    context: context,
    message: 'Custom Snackbar',
    description: 'This snackbar has custom options.',
    color: Colors.purple[800],
    icon: Icons.notifications,
    duration: const Duration(seconds: 5),
);

๐Ÿค Contributing

PRs, issues, and suggestions are welcome! Let's build together ๐Ÿš€


๐Ÿ“œ License

Licensed under the MIT License


๐Ÿ‘ค Author

deadlium


Libraries

motion_snackbar