top_snackbar 0.0.5 copy "top_snackbar: ^0.0.5" to clipboard
top_snackbar: ^0.0.5 copied to clipboard

A lightweight and easy-to-use flutter library tailored for top snackbar notifications. Customize styles, colors, icons and more with the ease.

Features #

  • Customizable styles including text, background color, leading icons and more
  • Responsive layout design, uses Media Queries to adapt on various screen sizes
  • Pre-defined methods for various message types with default styles and icons
  • Being an overlay, it doesn't disturb the widget tree or get affected by context change

Demo #

Screen Recording 2024-04-29 at 9 23 23 PM

Usage #

Installation #

Add top_snackbar to your pubspec.yaml file:

dependencies:
  top_snackbar: ^0.0.5 # Use the latest version

Import #

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

Custom Top Snackbar Widget #

To show a custom top snackbar message, use the CustomTopSnackbar.show method:

CustomTopSnackbar.show(
  context,
  'Your message here',
  // Customize more additional properties as required (optional)
  leadingIcon: Icons.copy,
  backgroundColor: Colors.blue,
);

Pre-defined Message Types #

The library provides pre-defined methods for different message types with default styles and icons:

  • Info: Display an informational message.
CustomTopSnackbar.showInfo(context, 'Info message');
  • Success: Display a success message.
CustomTopSnackbar.showSuccess(context, 'Success message');
  • Error: Display an error message.
CustomTopSnackbar.showError(context, 'Error message');
  • Warning: Display a warning message.
CustomTopSnackbar.showWarning(context, 'Warning message');
6
likes
160
pub points
75%
popularity

Publisher

verified publisheradarsh7.dev

A lightweight and easy-to-use flutter library tailored for top snackbar notifications. Customize styles, colors, icons and more with the ease.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on top_snackbar