Fancy Animated Snackbar

fancy_animated_snackbar is a Flutter package for creating visually appealing, highly customizable snackbars with smooth animations. It allows you to display snackbars with various customization options, including background color, icon color, text color, and alignment, with smooth slide and fade transitions.

Features

  • Smooth Animations: Enjoy smooth slide and fade animations for showing and hiding snackbars.
  • Customizable Appearance: Adjust the background color, icon color, text color, and duration of the snackbar.
  • Flexible Positioning: Position the snackbar at different locations on the screen (e.g., bottom center, top center).
  • Easy Integration: Simple to integrate into your Flutter app with easy-to-configure parameters.

Installation

To use fancy_animated_snackbar, add it to your pubspec.yaml file:

dependencies:
  fancy_animated_snackbar: ^1.0.0

Usage

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Fancy Animated Snackbar Example'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              FancyAnimatedSnackbar.successSnackbar(
                context,
                title: 'Success',
                subTitle: 'Operation completed successfully!',
              );
            },
            child: Text('Show Snackbar'),
          ),
        ),
      ),
    );
  }
}

Snackbar Types

  • Success Snackbar: Use CustomAnimatedSnackbar.successSnackbar(...)
  • Error Snackbar: Use CustomAnimatedSnackbar.errorSnackbar(...)
  • Info Snackbar: Use CustomAnimatedSnackbar.infoSnackbar(...)
  • Warning Snackbar: Use CustomAnimatedSnackbar.warningSnackbar(...)
  • Loading Snackbar: Use CustomAnimatedSnackbar.loadingSnackbar(...)

Parameters

  • context: BuildContext - The build context where the snackbar will be displayed.
  • snackIcon: IconData - The icon to display in the snackbar.
  • title: String - The main title text of the snackbar.and opacity change.
  • subTitle: String - The subtitle text of the snackbar.
  • snackBackColor: Color - The background color of the snackbar.
  • alignment: Alignment - The alignment of the snackbar on the screen (default is Alignment.bottomCenter).
  • snackIconBack: Color - The background color of the snack icon (default is Colors.green).
  • snackIconFront: Color - The color of the snack icon (default is Colors.white).
  • snackTextColor: Color - The color of the text in the snackbar (default is Colors.white)
  • duration: Duration - The duration for which the snackbar is visible (default is Duration(seconds: 4)).

Contact