objectvalidator 1.0.7

  • README.md
  • Installing
  • Versions
  • 42


Object-Validator for Dart


Define your class you want to validate:

class AnotherPerson {
    final int _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.


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


Unless required by applicable law or agreed to in writing, 
software distributed under the License is distributed on an 
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



  • ObjectValidator goes public 1dafd61


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

v1.0 - 2017-12-20


  • Sample für die Verwendung der lib 08ab94a

v0.2 - 2017-12-07



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

  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
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.10


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.


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.9
validate ^1.0.0 1.7.0
Transitive dependencies
analyzer 0.34.1
ansicolor 1.0.2
args 1.5.1
async 2.0.8
build 1.1.0
build_cli_annotations 1.0.1
build_config 0.3.1+4
build_resolvers 0.2.3
build_runner_core 1.1.3
built_collection 4.1.0
built_value 6.2.0
charcode 1.1.2
code_builder 3.1.3
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.2
fixnum 0.10.9
front_end 0.1.8
glob 1.1.7
graphs 0.2.0
html 0.13.3+3
http 0.12.0+1
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.8
meta 1.1.7
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.4.0
plugin 0.2.0+3
pool 1.4.0
pub_semver 1.4.2
pubspec_parse 0.1.4
quiver 2.0.1
shelf 0.7.4
shelf_web_socket 0.2.2+4
source_span 1.4.1 1.5.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 6.0.0
yaml 2.1.15
Dev dependencies
build_runner any 1.1.3
build_test any
build_web_compilers any
console_log_handler ^1.0.0 1.1.3
grinder any
test any