annotationscanner 0.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 33

annotationscanner

Scans root library for annotation usages.

Usage

A simple usage example:

import 'package:annotationscanner/annotationscanner.dart';

@MyAnnotationA(1)
void myMethodA() {
  print("myMethodA");
}

@MyAnnotationA(2)
void myMethodB() {
  print("myMethodB");
}

@MyAnnotationA(3)
@MyAnnotationB('one')
void myMethodC() {
  print("myMethodC");
}

@MyAnnotationB('two')
@MyAnnotationB('three')
void myMethodD() {
  print("myMethodD");
}

void myMethodE() {
  print("myMethodE");
}


main() {
  List<AnnotationUsage<MyAnnotationA>> scanA = AnnotationUsage.scanRootLibrary(MyAnnotationA);
  scanA.forEach((usage) {
    print(usage.singleAnnotation.valueA);
    usage.invoke([]);
  });
  List<AnnotationUsage<MyAnnotationB>> scanB = AnnotationUsage.scanRootLibrary(MyAnnotationB);
  scanB.forEach((usage) {
    print(usage.annotations);
    usage.invokeSync([]);
  });
}


class MyAnnotationA {
  final int valueA;

  const MyAnnotationA([this.valueA]);
}

class MyAnnotationB {
  final String valueB;

  const MyAnnotationB([this.valueB]);
}

Changelog

0.0.1

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  annotationscanner: "^0.0.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


      import 'package:annotationscanner/annotationscanner.dart';
  
Version Uploaded Documentation Archive
0.0.1 Jan 2, 2017 Go to the documentation of annotationscanner 0.0.1 Download annotationscanner 0.0.1 archive

Analysis

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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
74 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
55 / 100
Overall score:
Weighted score of the above. [more]
33
Learn more about scoring.

Platforms

Detected platforms: web, other

Primary library: package:annotationscanner/annotationscanner.dart with components: mirrors.

Suggestions

  • Package is getting outdated.

    The package was released 75 weeks ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

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

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 10 hints.

    Run dartfmt to format lib/annotationscanner.dart.

    Run dartfmt to format lib/src/annotationscanner_base.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0