-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit b060e40 Author: [email protected] <[email protected]> Date: Sat Aug 24 13:49:44 2019 +0530 Updated Pubspec commit 7790fb7 Author: [email protected] <[email protected]> Date: Sat Aug 24 13:47:58 2019 +0530 Updated README commit b884a6e Author: Ibrahim Mubarak <[email protected]> Date: Sat Aug 17 16:27:37 2019 +0530 Remove uses of dynamic commit 9effb5a Author: Ibrahim Mubarak <[email protected]> Date: Sat Aug 17 16:15:44 2019 +0530 Add Analysis Options commit aecb897 Author: Ibrahim Mubarak <[email protected]> Date: Sat Aug 17 15:18:18 2019 +0530 Add InRule, NotInRule, Deprecated OneOfRule commit f0c7dd8 Author: [email protected] <[email protected]> Date: Sat Aug 17 12:08:11 2019 +0530 Updated description commit 8dc0b51 Author: [email protected] <[email protected]> Date: Thu Aug 15 01:48:05 2019 +0530 Bumped version to 0.2.1, updated pub description
- Loading branch information
1 parent
456798a
commit 8a36422
Showing
25 changed files
with
215 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
include: package:pedantic/analysis_options.yaml | ||
|
||
linter: | ||
rules: | ||
- always_declare_return_types | ||
- always_put_control_body_on_new_line | ||
- always_put_required_named_parameters_first | ||
- always_specify_types | ||
- annotate_overrides | ||
- avoid_bool_literals_in_conditional_expressions | ||
- close_sinks | ||
- package_prefixed_library_names | ||
- prefer_const_declarations | ||
- prefer_const_literals_to_create_immutables | ||
- prefer_interpolation_to_compose_strings | ||
- prefer_typing_uninitialized_variables | ||
- prefer_void_to_null | ||
- sort_pub_dependencies | ||
- unnecessary_await_in_return | ||
- unnecessary_brace_in_string_interps | ||
- unnecessary_getters_setters | ||
- unnecessary_lambdas | ||
- unnecessary_null_aware_assignments | ||
- unnecessary_overrides | ||
- unnecessary_statements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
module.exports = { | ||
title: "Flrx Validator", | ||
description: "Validator on Steroids", | ||
base: "/validator/", | ||
themeConfig: { | ||
displayAllHeaders: true, // Default: false, | ||
sidebar: ["/", "/validator", "/rule"], | ||
nav: [ | ||
{ | ||
text: "Changelog", | ||
link: "https://github.com/flrx/validator/blob/master/CHANGELOG.md" | ||
}, | ||
], | ||
/* Repository Config */ | ||
repo: "flrx/validator", | ||
repoLabel: "Github", | ||
docsDir: "doc", | ||
docsBranch: "master", | ||
editLinks: true, | ||
editLinkText: "Help us improve this page!" | ||
}, | ||
title: "Flrx Validator", | ||
description: "Validator on Steroids", | ||
base: "/validator/", | ||
themeConfig: { | ||
displayAllHeaders: true, // Default: false, | ||
sidebar: ["/", "/validator", "/rule"], | ||
algolia: { | ||
apiKey: '1cc6df72a7d648335129bdef99facc02', | ||
indexName: 'flrx_validator' | ||
}, | ||
nav: [ | ||
{ | ||
text: "Changelog", | ||
link: "https://github.com/flrx/validator/blob/master/CHANGELOG.md" | ||
}, | ||
{ | ||
text: "API Docs", | ||
link: "https://pub.dev/documentation/flrx_validator/latest/" | ||
}, | ||
], | ||
/* Repository Config */ | ||
repo: "flrx/validator", | ||
repoLabel: "Github", | ||
docsDir: "doc", | ||
docsBranch: "master", | ||
editLinks: true, | ||
editLinkText: "Help us improve this page!" | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:flrx_validator/rule.dart'; | ||
|
||
/// A [Rule] subclass validating if the input is one of the element in the [acceptedList]. | ||
class InRule<T> extends Rule<T> { | ||
final List<T> acceptedList; | ||
|
||
InRule(this.acceptedList, {String validationMessage}) | ||
: super(validationMessage); | ||
|
||
@override | ||
String onValidate(String entityName, T value) { | ||
String validationMessage = ":entity is not in list of accepted values"; | ||
return acceptedList.contains(value) ? null : validationMessage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:flrx_validator/rule.dart'; | ||
|
||
/// A [Rule] subclass validating if the input is one of the element in the [rejectionList]. | ||
class NotInRule<T> extends Rule<T> { | ||
final List<T> rejectionList; | ||
|
||
NotInRule(this.rejectionList, {String validationMessage}) | ||
: super(validationMessage); | ||
|
||
@override | ||
String onValidate(String entityName, T value) { | ||
String validationMessage = ":entity is in list of rejected values"; | ||
return rejectionList.contains(value) ? validationMessage : null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import 'package:flrx_validator/rule.dart'; | ||
import 'package:flrx_validator/rules/in_rule.dart'; | ||
|
||
/// A [Rule] subclass validating if the input is one of the element in the [acceptedList]. | ||
class OneOfRule<T> extends Rule<T> { | ||
final List<T> acceptedList; | ||
@Deprecated('Use InRule instead') | ||
class OneOfRule<T> extends InRule<T> { | ||
|
||
OneOfRule(this.acceptedList, {String validationMessage}) | ||
: super(validationMessage); | ||
OneOfRule(List<T> acceptedList, {String validationMessage}) | ||
: super(acceptedList, validationMessage: validationMessage); | ||
|
||
@override | ||
String onValidate(String entityName, T value) { | ||
String validationMessage = ":entity is not in list of accepted values"; | ||
return acceptedList.contains(value) ? null : validationMessage; | ||
return super.onValidate(entityName, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
name: flrx_validator | ||
description: > | ||
A powerful, extensible validator package to get validation messages based on a list of rules. | ||
version: 0.2.0 | ||
version: 0.3.0 | ||
author: Flrx Team <[email protected]> | ||
homepage: https://flrx.github.io/validator/ | ||
repository: https://github.com/flrx/validator | ||
issue_tracker: https://github.com/flrx/validator/issues | ||
documentation: https://flrx.github.io/validator/ | ||
|
||
environment: | ||
sdk: ">=2.2.2 <3.0.0" | ||
|
@@ -14,3 +17,4 @@ dependencies: | |
dev_dependencies: | ||
test: ^1.6.5 | ||
test_coverage: ^0.3.0+1 | ||
pedantic: ^1.8.0 |
Oops, something went wrong.