Lightweight library for validating function arguments in Dart.
This library is mainly a port of Apaches org.apache.commons.lang3.Validate class
Validation is necessary on most public-facing APIs. Parameter validation on non-public methods is not as important - it is often desirable to have validation occur only once, at the public 'entry point' - but if you can live with the potential performance hit, I recommend to validate parameters everywhere, as it makes code maintenance and refactoring a bit easier.
For further documentation please refere to the Unit-Tests.
You can see further changes on the CHANGELOG!
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.
This class assists in validating method arguments
This CHANGELOG.md was generated with Changelog for Dart
Add this to your package's pubspec.yaml file:
dependencies: validate: ^1.7.0
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|1.7.0||Aug 21, 2018|
|1.6.1||Aug 14, 2018|
|1.6.0||Dec 13, 2017|
|1.5.4||Jan 31, 2017|
|1.5.3||Nov 16, 2016|
|1.5.2||Jul 14, 2016|
|1.5.1||Dec 8, 2015|
|1.5.0||Dec 8, 2015|
|1.4.2||Dec 19, 2014|
|1.4.1||Dec 19, 2014|
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]
We analyzed this package on Jun 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, web, other
No platform restriction found in primary library
lib/validate.dart. (-6.78 points)
lib/validate.dart reported 14 hints, including:
line 51 col 1: Prefer using /// for doc comments.
line 90 col 5: Prefer using /// for doc comments.
line 108 col 5: Prefer using /// for doc comments.
line 135 col 5: Prefer using /// for doc comments.
line 166 col 5: Prefer using /// for doc comments.
lib/src/utils.dart. (-0.50 points)
lib/src/utils.dart reported 1 hint:
line 27 col 37: Use
= to separate a named parameter from its default value.
dartfmt to format
dartfmt to format
analysis_options.yaml. (-10 points)
Change the name of your package's
.analysis_options file to
The package description is too short. (-11 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
validate.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.