objectvalidator 1.0.7

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 42

ObjectValidator

Object-Validator for Dart

Usage

Define your class you want to validate:

@validator
class AnotherPerson {
    final int _age;

    AnotherPerson(this._age);

    @Range(start: 15.0, end: 55.0, message: const L10N("Age must be between 15 and 55 years"))
    int get age => _age;
}

Validation looks like this:

final AnotherPerson person1 = AnotherPerson(55);
final ObjectValidator<AnotherPerson> ov = new ObjectValidator<AnotherPerson>();

List<ViolationInfo> violationInfos = ov.validate(person1);
expect(violationInfos.length, 0);

final AnotherPerson person2 = AnotherPerson(14);

violationInfos = ov.validate(person2);
expect(violationInfos.length, 1);

expect(violationInfos[0].message, "Age must be between 15 and 55 years");

For more - check out my tests...

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

Copyright 2018 Michael Mitterer, IT-Consulting and Development Limited,
Austrian Branch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, 
software distributed under the License is distributed on an 
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
either express or implied. See the License for the specific language 
governing permissions and limitations under the License.

If this plugin is helpful for you - please (Circle) me.

Change Log for objectvalidator

Object validation library

Unreleased

Feature

  • ObjectValidator goes public 1dafd61

Refactor

  • Description + Homepage was missing in pubspec.yaml ff1ad24
  • Added dryice as indirect dependency - needed by reflectable fc213dd

v1.0 - 2017-12-20

Docs

  • Sample für die Verwendung der lib 08ab94a

v0.2 - 2017-12-07

Feature

Docs

  • Sample für die Verwendung der lib 08ab94a

This CHANGELOG.md was generated with Changelog for Dart

Use this package as a library

1. Depend on it

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


dependencies:
  objectvalidator: ^1.0.7

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:objectvalidator/objectvalidator.dart';
  
Version Uploaded Documentation Archive
1.0.7 Aug 30, 2018 Go to the documentation of objectvalidator 1.0.7 Download objectvalidator 1.0.7 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.6

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Format lib/constraints.dart.

Run dartfmt to format lib/constraints.dart.

Format lib/constraints/matchers.dart.

Run dartfmt to format lib/constraints/matchers.dart.

Format lib/objectvalidator.dart.

Run dartfmt to format lib/objectvalidator.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/objectvalidator/ObjectValidator.dart (Run dartfmt to format lib/objectvalidator/ObjectValidator.dart.)
  • lib/objectvalidator/ViolationException.dart (Run dartfmt to format lib/objectvalidator/ViolationException.dart.)
  • lib/objectvalidator/ViolationInfo.dart (Run dartfmt to format lib/objectvalidator/ViolationInfo.dart.)

Maintenance issues and suggestions

Use analysis_options.yaml. (-10 points)

Rename old .analysis_options file to analysis_options.yaml.

Read more about the setup of analysis-options.yaml.

The description is too short. (-20 points)

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

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use objectvalidator.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
dryice >=2.0.22 <3.0.0 2.0.26
l10n >=1.4.0 <2.0.0 1.4.0 2.0.15
logging >=0.11.3 <1.0.0 0.11.3+2
matcher ^0.12.0 0.12.4
reflectable ^2.0.0 2.0.8
validate ^1.0.0 1.7.0
Transitive dependencies
analyzer 0.33.3+1
ansicolor 1.0.2
args 1.5.1
async 2.0.8
build 1.0.1
build_cli_annotations 1.0.0
build_config 0.3.1+4
build_resolvers 0.2.2+6
build_runner_core 1.1.0
built_collection 4.0.0
built_value 6.1.6
charcode 1.1.2
code_builder 3.1.3
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.0
fixnum 0.10.9
front_end 0.1.6+4
glob 1.1.7
graphs 0.1.3+1
html 0.13.3+3
http 0.12.0
http_multi_server 2.0.5
http_parser 3.1.3
intl 0.15.7
io 0.3.3
js 0.6.1+1
json_annotation 2.0.0
kernel 0.3.6+4
meta 1.1.6
mime 0.9.6+2
optional 3.0.0+2
package_config 1.0.5
package_resolver 1.0.6
path 1.6.2
pedantic 1.3.0
plugin 0.2.0+3
pool 1.3.6
pub_semver 1.4.2
pubspec_parse 0.1.2+3
quiver 2.0.1
shelf 0.7.3+3
shelf_web_socket 0.2.2+4
source_span 1.4.1
stack_trace 1.9.3
stream_channel 1.6.8
stream_transform 0.0.14+1
string_scanner 1.0.4
timing 0.1.1+1
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
web_socket_channel 1.0.9
where 4.4.0 5.0.0
yaml 2.1.15
Dev dependencies
build_runner any 1.1.2
build_test any
build_web_compilers any
console_log_handler ^1.0.0 1.1.3
grinder any
test any