pl_notifications 0.0.3+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 63

Buy Me A Coffee

pl_notifications #

A service class to display overlay notifications like toasts but with custom widgets.

Getting Started #

Just install the package on the pubspec.yaml file, run the flutter packages get command, for importing the package and use just like so

PlNotifications.showMessage(
    context,
    Text('A title'),
    subtitle: Text('A subtitle'),
    Duration(seconds: 5),
    icon: Icon(Icons.error),
);

Screenshots

[0.0.1] - TODO: Add release date. #

  • TODO: Describe initial release.

[0.0.2] - Automated tests implemented. New features #

Makes possible to use custom widgets in the standard notification ListTile widget

[0.0.3] - Many improvements on custom Widget Notification #

Improves quality of the custom notification widget construction. Allows the user to invoke the notification close function from the custom notification widget

example/example.dart

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

class Example extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('A PlNotifications test')),
      persistentFooterButtons: <Widget>[
        FlatButton.icon(
          onPressed: () {
            PlNotifications.showSuccess(context, 'title');
          },
          icon: Icon(Icons.check_box, color: Colors.green),
          label: Text('Success Notification'),
        ),
        FlatButton.icon(
          onPressed: () {
            PlNotifications.showError(context, 'title');
          },
          icon: Icon(Icons.error, color: Colors.red),
          label: Text('Error Notification'),
        ),
        FlatButton.icon(
          onPressed: () {
            PlNotifications.showMessage(context, Text('title'));
          },
          icon: Icon(Icons.message),
          label: Text('Regular Notification'),
        ),
      ],
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  pl_notifications: ^0.0.3+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pl_notifications/pl_notifications.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • pl_notifications that is a package requiring null.

Health suggestions

Fix lib/pl_notification_container.dart. (-1 points)

Analysis of lib/pl_notification_container.dart reported 2 hints:

line 40 col 13: The left operand uses '?.', so its value can be null.

line 41 col 14: The left operand uses '?.', so its value can be null.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://playlines.web.app was unreachable.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test