jaguar_validate 0.0.11

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 61

jaguar_validate

A simple, source generated Validator framework

Features

  1. Both reflection and source generation are supported
  2. Annotation based validators
  3. Supports validation of nested objects

Usage

A simple usage example:

library jaguar_validate.example.simple;

import 'dart:async';
import 'package:jaguar_validate/jaguar_validate.dart';

part 'simple_example.g.dart';

@GenValidator()
class Author extends _Author {
  @HasLenInRange(1, 10)
  String name;

  @IsEmail()
  String email;

  @IsInRange(20, 30)
  int age;

  Author.make(this.name, this.email, this.age);
}

@GenValidator()
class Book extends _Book {
  Book.make(this.name, this.author, this.abstract, this.pages, this.price);

  @HasLenInRange(1, 25)
  String name;

  @ValidateValidatable()
  Author author;

  @HasLenInRange(15, 1000)
  String abstract;

  @IsGreaterThan(0)
  int pages;

  @IsInRange(1, 200)
  int price;
}

main() async {
  try {
    String abstract = """
    Whatever is abstract. Whatever maybe. Whatever could be an abstract.
    Scientific papers are usually dumb page fillers.
    """;
    Author author = new Author.make('Mark', 'mark@books.com', 25);
    Book book = new Book.make('Fantastic beasts', author, abstract, 100, 100);
    await book.validate();
  } on ValidationErrors catch (e) {
    print(e);
  }
}

Changelog

0.0.1

  • Initial version, created by Stagehand

1. Depend on it

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


dependencies:
  jaguar_validate: "^0.0.11"

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 packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:jaguar_validate/jaguar_validate.dart';
        
Version Uploaded Documentation Archive
0.0.11 Jun 4, 2017 Go to the documentation of jaguar_validate 0.0.11 Download jaguar_validate 0.0.11 archive
0.0.10 Jun 4, 2017 Go to the documentation of jaguar_validate 0.0.10 Download jaguar_validate 0.0.10 archive
0.0.9 Mar 5, 2017 Go to the documentation of jaguar_validate 0.0.9 Download jaguar_validate 0.0.9 archive
0.0.8 Dec 26, 2016 Go to the documentation of jaguar_validate 0.0.8 Download jaguar_validate 0.0.8 archive
0.0.7 Dec 26, 2016 Go to the documentation of jaguar_validate 0.0.7 Download jaguar_validate 0.0.7 archive
0.0.6 Dec 26, 2016 Go to the documentation of jaguar_validate 0.0.6 Download jaguar_validate 0.0.6 archive
0.0.5 Dec 26, 2016 Go to the documentation of jaguar_validate 0.0.5 Download jaguar_validate 0.0.5 archive
0.0.4 Dec 26, 2016 Go to the documentation of jaguar_validate 0.0.4 Download jaguar_validate 0.0.4 archive
0.0.3 Dec 26, 2016 Go to the documentation of jaguar_validate 0.0.3 Download jaguar_validate 0.0.3 archive
0.0.2 Dec 25, 2016 Go to the documentation of jaguar_validate 0.0.2 Download jaguar_validate 0.0.2 archive

All 11 versions...

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
23 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
61

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • 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.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use jaguar_validate.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
build >=0.9.3 <0.10.0 0.9.3 0.12.0+1
build_runner >=0.3.4 <0.4.0 0.3.4+1 0.7.9
intl >=0.14.0 <0.15.0 0.14.0 0.15.2
source_gen ^0.5.1 0.5.10+1 0.7.4+3
source_gen_help >=0.0.4 <0.1.0 0.0.4
yaml >=2.1.10 <3.0.0 2.1.13
Transitive dependencies
analyzer 0.30.0+4 0.31.0+1
args 1.3.0
async 1.13.3 2.0.3
barback 0.15.2+14
build_barback 0.3.0 0.5.0+3
charcode 1.1.1
cli_util 0.1.2+1
code_transformers 0.5.1+4
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
dart_style 1.0.9+1
front_end 0.1.0-alpha.4.1 0.1.0-alpha.8
glob 1.1.5
html 0.13.2+2
http_parser 3.1.1
isolate 1.1.0
kernel 0.3.0-alpha.1.1 0.3.0-alpha.5
logging 0.11.3+1
meta 1.1.2
mime 0.9.6
package_config 1.0.3
path 1.5.1
plugin 0.2.0+2
pool 1.3.4
shelf 0.6.8 0.7.2
shelf_static 0.2.7
source_maps 0.10.4
source_span 1.4.0
stack_trace 1.9.1
stream_channel 1.6.3
stream_transform 0.0.10
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
Dev dependencies
test >=0.12.0 <0.13.0