non_null 0.0.1

  • README.md
  • Example
  • Installing
  • Versions
  • 52

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 packages get

Alternatively, your editor might support pub get or flutter packages 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';
  
Version Uploaded Documentation Archive
0.0.1 Sep 11, 2018 Go to the documentation of non_null 0.0.1 Download non_null 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
52
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Format lib/non_null.dart.

Run dartfmt to format lib/non_null.dart.

Maintenance issues and suggestions

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

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

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

Dependencies

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