GithubHelp home page GithubHelp logo

dineshkumar02 / awesome_snackbar_content Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mhmzdev/awesome_snackbar_content

0.0 0.0 0.0 24 KB

A beautiful dart package to uplift your SnackBar experiences in the application

Home Page: https://pub.dev/packages/awesome_snackbar_content

License: MIT License

Dart 100.00%

awesome_snackbar_content's Introduction

A package that lets you uplift your SnackBar experience in the app.

๐Ÿ›  Attributes

  • title: Top label that will be shown in the body
  • message: Body message reflecting some error message, success message etc.
  • color: Color of SnackBar body
  • contentType: ContentType class reflecting failure, success, help or warning.

๐Ÿ“ฑ Usage

To use the package:

  • add the dependency to your pubspec.yaml file
dependencies:
  flutter:
      sdk: flutter

  awesome_snackbar_content:

Then import it in your flutter project:

import 'package:awesome_snackbar_content/awesome_snackbar_content.dart';

๐Ÿ‘€ Looks

Below are the looks of various types in package

๐Ÿ”ด Failure

โœ… Success

โ” Help

โš  Warning

๐Ÿ’ป Example

Below is a basic example usage of the awesome_snackbar_content

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ElevatedButton(
          child: const Text('Show Awesome SnackBar'),
          onPressed: () {
            var snackBar = SnackBar(
              elevation: 0,
              behavior: SnackBarBehavior.floating,
              backgroundColor: Colors.transparent,
              content: AwesomeSnackbarContent(
                title: 'On Snap!',
                message:
                    'This is an example error message that will be shown in the body of snackbar!',
                contentType: ContentType.failure,
              ),
            );

            ScaffoldMessenger.of(context).showSnackBar(snackBar);
          },
        ),
      ),
    );
  }
}

๐Ÿง‘ Credits

This packages has been created in reference to Abu Anwar (GDE Flutter) YouTube video. So, make sure to check his work!

awesome_snackbar_content's People

Contributors

mhmzdev avatar dineshkumar02 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.