non_null 0.0.1

NonNull Annotaion #

Only annotaion @non_null. Use it to specify arguments or returned values are not nullable.

You should not give null to @non_null annotated arguments. And you should expect returned values from @non_null annotated functions or methods.

It expects to be used by linters, source_gen Generators or something else.

Example #

See example/main.dart.

import 'package:non_null/non_null.dart';

@non_null
String foo(@non_null bar) {
    return "FOO $bar";
}

void main() {
    // `value` is not null (if you believe annotation).
    // And DON'T give `null` to foo's argument.
    final value = foo("BAR");
    print(value);
}

License #

NonNull Annotation by kikuchy is licensed under the Apache License, Version2.0

example/main.dart

library non_null.example;

import 'package:non_null/non_null.dart';

@non_null
String foo(@non_null bar) {
    return "FOO $bar";
}

void main() {
    // `value` is not null (if you believe annotation).
    // And DON'T give `null` to foo's argument.
    final value = foo("BAR");
    print(value);
}

Use this package as a library

1. Depend on it

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


dependencies:
  non_null: ^0.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:non_null/non_null.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]
63
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Oct 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:non_null/non_null.dart.

Health suggestions

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

Analysis of lib/non_null.dart reported 2 hints:

line 20 col 1: Prefer using /// for doc comments.

line 29 col 1: Prefer using /// for doc comments.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

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.

Package is getting outdated. (-7.12 points)

The package was last published 55 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0