flutter_inapp_notifications

Creator: coderz1093

Last updated:

Add to Cart

Description:

flutter inapp notifications

Flutter In-App Notifications #
A simple Flutter package to generate instant in-app notifications.


Installing #
Add this to your package's pubspec.yaml file:
dependencies:
flutter_inapp_notifications: ^1.0.0
copied to clipboard
Import #
import 'package:flutter_inapp_notifications/flutter_inapp_notifications.dart';
copied to clipboard
How to use #
First, initialize InAppNotifications in your MaterialApp/CupertinoApp:
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter InAppNotifications',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter InAppNotifications'),
builder: InAppNotifications.init(),
);
}
}
copied to clipboard
Then:
InAppNotifications.show(
title: 'Welcome to InAppNotifications',
leading: Icon(
Icons.fact_check,
color: Colors.green,
size: 50,
),
ending: Icon(
Icons.arrow_right_alt,
color: Colors.red,
),
description:
'This is a very simple notification with leading and ending widget.',
onTap: () {
// Do whatever you need!
});
copied to clipboard
You can play around with leading and ending widgets, as well as not sending any of them.
Add loading status callback
InAppNotifications.addStatusCallback((status) {
print('InAppNotifications Status $status');
});
copied to clipboard
Remove loading status callback(s)
InAppNotifications.removeCallback(statusCallback);

InAppNotifications.removeAllCallbacks();
copied to clipboard
Customize #
Customization is pretty straighforward, I'm actually working on more attributes to customize. Feel free to request new customizations.
Customize it anywhere:
InAppNotifications.instance
..titleFontSize = 14.0
..descriptionFontSize = 14.0
..textColor = Colors.black
..backgroundColor = Colors.white
..shadow = true
..animationStyle = InAppNotificationsAnimationStyle.scale;

// Custom animation
InAppNotifications.instance
..titleFontSize = 14.0
..descriptionFontSize = 14.0
..textColor = Colors.black
..backgroundColor = Colors.white
..shadow = true
..customAnimation = MyCustomAnimation()
..animationStyle = InAppNotificationsAnimationStyle.custom;
copied to clipboard
Changelog #
CHANGELOG
License #
MIT License
This was possible thanks to #
easy_loading ❤️
This package was an inspiration, as well as a great reference to create this kind of packages.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.