flutter_inapp_notifications 0.0.2 copy "flutter_inapp_notifications: ^0.0.2" to clipboard
flutter_inapp_notifications: ^0.0.2 copied to clipboard

outdated

A simple Flutter package to generate instant in-app notifications.

Flutter In-App Notifications #

A simple Flutter package to generate instant in-app notifications.

license

flutter_inapp_notifications_demo

Installing #

The publishing to pub.dev is still processing, once it is successfully published, you just need to:

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_inapp_notifications: ^0.0.2

Import #

import 'package:flutter_inapp_notifications/flutter_inapp_notifications.dart';

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(),
    );
  }
}

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!
    });

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');
});

Remove loading status callback(s)

InAppNotifications.removeCallback(statusCallback);

InAppNotifications.removeAllCallbacks();

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;

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.

17
likes
0
pub points
86%
popularity

Publisher

verified publishertheflutterist.com

A simple Flutter package to generate instant in-app notifications.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_inapp_notifications