motion_snackbar 0.0.6
motion_snackbar: ^0.0.6 copied to clipboard
Flutter animated snackbars: success, error, info, warning & custom. Smooth directional transitions, fully customizable!
๐งณ Animated Snackbars #
A Flutter package to display beautiful, animated snackbars with directional slide-in/out transitions. Includes preset styles for success, error, info, and warning messages โ plus full customization options.
โจ Features #
Feature | Description |
---|---|
๐ Animated | Smooth slide-in/out animation |
โ๏ธ Directional | Slides in from bottom |
โ Presets | showSuccessSnackbar , showErrorSnackbar , etc. |
๐จ Customizable | Control color, icon, duration, message, and description |
๐ซ Single Instance | Only one snackbar visible at a time |
โจ๏ธ Keyboard Aware | Snackbar appears above keyboard & respects safe area |
Example Images
๐ ๏ธ Installation #
Add dependencies in pubspec.yaml
:
dependencies:
animated_snackbars: ^<latest_version>
Then run:
flutter pub get
๐ฐ Import #
import 'package:animated_snackbars/animated_snackbars.dart';
๐ Usage #
๐งช Basic Example #
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Animated Snackbars Example')),
body: Center(
child: ElevatedButton(
onPressed: () {
SnackbarUtils.showAnimatedSnackbar(
context: context,
message: 'Hello, this is a snackbar!',
description: 'This is a more detailed message.',
);
},
child: const Text('Show Snackbar'),
),
),
),
);
}
}
๐ Preset Snackbars #
SnackbarUtils.showErrorSnackbar(
context: context,
message: 'Success!',
description: 'The operation was completed successfully.',
);
SnackbarUtils.showErrorSnackbar(
context: context,
message: 'Oops!',
description: 'Something went wrong.',
);
SnackbarUtils.showInfoSnackbar(
context: context,
message: 'Heads up!',
description: 'Here is some important information.',
);
SnackbarUtils.showWarningSnackbar(
context: context,
message: 'Warning!',
description: 'Please be careful.',
);
๐ ๏ธ Custom Snackbar #
SnackbarUtils.showAnimatedSnackbar(
context: context,
message: 'Custom Snackbar',
description: 'This snackbar has custom options.',
color: Colors.purple[800],
icon: Icons.notifications,
duration: const Duration(seconds: 5),
);
๐ค Contributing #
PRs, issues, and suggestions are welcome! Let's build together ๐
๐ License #
Licensed under the MIT License
๐ค Author #
deadlium