Skip to content

fabrik_snackbar

pub.dev

The Fabrik Snackbar package is a customizable, production-ready solution for showing snackbars and toasts in your Flutter app. It’s designed to be simple to use, highly configurable, and seamlessly integrated with your app’s theme.

Add the package to your pubspec.yaml:

dependencies:
fabrik_snackbar: ^0.1.0

Then run:

Terminal window
flutter pub get

Import fabrik_snackbar in your Dart files:

import 'package:fabrik_snackbar/fabrik_snackbar.dart';

You’re now ready to display your first snackbar or toast.

You can choose from prebuilt snackbar variants or create a custom snackbar. The prebuilt options cover most common use cases, eliminating the need to manually configure properties like snackbar color, icon color, and more.

FabrikSnackbar.success(
context,
title: 'Registration Successful!',
message: 'You have been successfully registered.',
);
FabrikSnackbar.error(
context,
title: 'Error Occurred',
message: 'Something went wrong, please try again.',
);
FabrikSnackbar.info(
context,
title: 'Heads Up!',
message: 'New update is available.',
);
FabrikSnackbar.warning(
context,
title: 'Warning!',
message: 'Your internet is unstable.',
);
FabrikSnackbar.custom(
context,
title: 'Custom Title',
message: 'Custom background and style.',
backgroundColor: Colors.purple,
borderRadius: BorderRadius.circular(16),
duration: const Duration(seconds: 2),
);

Use the FabrikToast.show method to display a toast from anywhere in your app:

FabrikToast.show(
context,
message: 'Copied to Clipboard!',
);

These come with built-in styles that you can override globally or per use.