The Opensyd reusability approach for validators in Dart. Based on
Verbal Expressions.
var email = 'dude@email.com';
if (validadeEmail(email) {
register(email);
}
Used when you want to someone choose a date after today.
var date = new DateTime('2099', '11', '21');
if (validadeFutureDate(date) {
someCode(date);
}
Used when you want to the user enters only characters used
in common dissertative or descritive texts.
var text = '''
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
In molestie bibendum gravida. Sed egestas venenatis ex,
vitae malesuada nibh consectetur nec. Integer posuere
pharetra justo, et egestas tellus imperdiet sed. Proin
eu augue molestie, egestas libero sed, tempus sapien.
''';
if (validateText(text) {
sendToBlog(text);
}
Validate common used chars for names, in Western method (needs upgrade).
var name = 'Roberto Santos Carlos Almeidinha';
if (validateNameWithSpace(name) {
register(name);
}
var address = 'Priest Namegon St, 992 - Simula, DE';
if (validateAddress(address) {
sendPackageTo(address);
}
var phone = '+42 11 99299-2299';
if (validatePhone(phone) {
call(phone);
}
venosyd ©2016
example/venosyd_common_validators_example.dart
/**
* @author sergio lisan
*
* see LICENSE
*
* validators sample
*
*/
main() {
}
Add this to your package's pubspec.yaml file:
dependencies:
venosyd_common_validators: "^1.0.2"
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.
Now in your Dart code, you can use:
import 'package:venosyd_common_validators/venosyd_common_validators.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
1.0.2 | Feb 17, 2017 |
|
|
1.0.1 | Dec 16, 2016 |
|
|
1.0.0 | Dec 16, 2016 |
|
|
We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
26 | / 100 |
Health:
Code health derived from static analysis.
[more]
|
93 | / 100 |
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
82 | / 100 |
Overall score:
Weighted score of the above.
[more]
|
57 |
Detected platforms: Flutter, web, other
No platform restriction found in primary library
package:venosyd_common_validators/venosyd_common_validators.dart
.
Fix .analysis_options
.
We were unable to parse
.analysis_options
.
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.
Fix analysis and formatting issues.
Analysis or formatting checks reported 5 hints.
Run
dartfmt
to formatlib/src/date_eval.dart
.Run
dartfmt
to formatlib/src/number_eval.dart
.Similar analysis of the following files failed:
lib/src/specialchar_eval.dart
(hint)lib/src/text_eval.dart
(hint)lib/venosyd_common_validators.dart
(hint)
Use analysis_options.yaml
.
Rename old
.analysis_options
file toanalysis_options.yaml
.
Enable strong mode analysis.
Strong mode helps you to detect bugs and potential issues earlier.Start your
analysis_options.yaml
file with the following:analyzer: strong-mode: true
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=1.0.0 <2.0.0 | ||
intl | >=0.12.0 <0.15.0 | 0.14.0 | 0.15.6 |
verbal_expressions | >=0.3.0 <0.4.0 | 0.3.1 | |
Dev dependencies | |||
test | >=0.12.0 <0.13.0 |