This is the fancy SnackBar/toast for flutter.

Overview

Fancy Snackbar 🎯

Fancy Snackbar for notifications, 
alert messages, information messages,
waiting messages, warnings and success messages.

Types

  • SUCCESS

  • ERROR

  • INFO

  • WAITING

  • WARNING

How to use

fancy_snackbar:
    git:
      url: https://github.com/MR0100/fancy_snackbar.git
  • explanations
/// FancySnackbar.showSnackbar() : it is the main method while will be used to render the snackbar.

/// there are some of the properties of the showSnackbar method.

/// context : context is the important property of snackbar to render on the display. 
/// context helps snackbar to find the screen where to render and where to take place in the widget tree.

/// snackBarType : this is the enumeration for the all available types of the snackbar.

/// Currently we are providing five types of snackbar.
/// 1. Success : FancySnackBarType.success
/// 2. Error : FancySnackBarType.error
/// 3. Info : FancySnackBarType.info
/// 4. Wating : FancySnackBarType.waiting
/// 5. Warning : FancySnackBarType.warning

/// title : it is the title of the snackbar.
/// message : it is the message of snackbar.

/// duration : it defines that how long you want to show the snackbar on the screen.
/// default duration is 3 seconds.
/// there you have to directly pass the duration.
/// 0.5 is calculated as 500 milliseconds. 
/// 1 is calculated as 1000 milliseconds = 1 second.

/// onCloseEvent : if you want to do some task when snackbar closes then you can write the code in this callback.

FancySnackbar.showSnackbar(
  context,
  snackBarType: FancySnackBarType.success,
  title: "Success Title",
  message: "Success Message",
  duration: 5,
  onCloseEvent: () {},
);

Example

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

void main() {
  return runApp(const MySnackBar());
}

class MySnackBar extends StatelessWidget {
  const MySnackBar({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: ["success", "error", "waitting", "info", "warning"]
              .map((e) => GestureDetector(
                    onTap: () {
                      FancySnackbar.showSnackbar(
                        context,
                        snackBarType: FancySnackBarType.success,
                        title: "Success Title",
                        message: "Success Message",
                        duration: 5,
                        onCloseEvent: () {},
                      );
                    },
                    child: Container(
                      margin: const EdgeInsets.symmetric(vertical: 20),
                      padding: const EdgeInsets.symmetric(
                          horizontal: 20, vertical: 10),
                      color: Colors.blue,
                      child: Text(e),
                    ),
                  ))
              .toList(),
        ),
      ),
    );
  }
}

You might also like...

Various Flutter widgets that are developed by Google but not by the core Flutter team

Flutter widgets This repository contains the source code for various Flutter widgets that are developed by Google but not by the core Flutter team. Is

Nov 21, 2022

🟥 A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

🟥 A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

Oct 8, 2022

A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter

A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter

flutter_floatwing A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter. Android only Features Pure Flu

Nov 17, 2022

Flutter Application to test basic flutter understanding

Flutter Application to test basic flutter understanding Getting Started Before you start with the application have a look at what

Apr 16, 2022

Flutter UI Widgets Flutter Package

Flutter UI Widgets Flutter Package This package makes different Flutter UI widgets implementation easy for you. Flutter UI Widgets The list of widgets

May 6, 2022

React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.

English | Português Flutter Hooks A Flutter implementation of React hooks: https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889 Ho

Nov 26, 2022

Simple form maker for Flutter Framework

Simple form maker for Flutter Framework

Flutter FormBuilder - flutter_form_builder This package helps in creation of data collection forms in Flutter by removing the boilerplate needed to bu

Nov 18, 2022

A credit card widget for Flutter application.

A credit card widget for Flutter application.

A credit card widget for Flutter application.

Nov 17, 2022

Code generation for Flutter Padding widgets based on your constants

Code generation for Flutter Padding widgets based on your constants

Oct 20, 2022
Owner
Mitul Vaghasiya
FLUTTER / DART || ANDROID / IOS DEVELOPMENT || HYBRID APPLICATION DEVELOPMENT || MOBILE APPLICATION DEVELOPER
Mitul Vaghasiya
Make your native android Dialog Fancy and Gify.

Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.

Shashank Singhal 519 Nov 10, 2022
A really easy to use flutter toast library

BotToast ?? A really easy to use flutter toast library! Language: English | 中文简体 ?? Overview ?? Online Demo ?? Example ?? Renderings ?? Getting starte

null 713 Nov 10, 2022
A pure flutter toast library

oktoast A library for flutter. A pure dart toast Library. You can completely customize the style of toast. 中文博客介绍 Screenshot Default Custom GIF Versio

OpenFlutter 431 Nov 22, 2022
A package for flutter to use alert and toast within one line code.

easy_alert A package for flutter to use alert and toast within one line code. Getting Started Add easy_alert: to your pubspec.yaml, and run flutt

null 34 Jun 25, 2021
A Styled Toast Flutter package.

flutter_styled_toast A Styled Toast Flutter package. You can highly customize toast ever. Beautify toast with a series of animations and make toast mo

null 66 Oct 11, 2022
Provider support for overlay, make it easy to build toast and In-App notification.

overlay_support Provider support for overlay, make it easy to build toast and In-App notification. this library support ALL platform Interaction If yo

Bin 336 Nov 23, 2022
Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.

assorted_layout_widgets I will slowly but surely add interesting widgets, classes and methods to this package. Despite the package name, they are not

Marcelo Glasberg 118 Oct 20, 2022
Flutter Carousel Pro - A Flutter Carousel widget

Carousel Extended A Flutter Carousel widget. Usage As simple as using any flutter Widget. Based on Carousel Pro but extended to be able to navigate be

omid habibi 3 Dec 7, 2020
Flutter-useful-widgets - Flutter Useful Widgets

useful_widgets This package makes it easy to build apps by providing a list of simple and useful widgets. import 'package:useful_widgets/useful_widget

Ricardo Crescenti 6 Jun 20, 2022
Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Kim Seung Hwan 6 Mar 11, 2022