Skip to content

Commit

Permalink
update readme, update regexp utils
Browse files Browse the repository at this point in the history
  • Loading branch information
ariefsn committed Jul 5, 2020
1 parent 55152ba commit bade239
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
## [0.1.0] - 2020-07-05
* Update description, format lib files.

## [0.0.1] - 2020-07-05
* New toolkit for map, random, sleep, and string.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Toolkit

> Just a simple toolkit for dart.
> Just a simple toolkit for flutter. Some APIs are ready to help manipulate map, string, random, and sleep. Hopefully can be useful.
### Usage

Expand Down Expand Up @@ -45,7 +45,7 @@
- `sleepMinutes(int minutes)` => `Future`
> Set sleep in minutes.
- `sleepHour(int hours)` => `Future`
- `sleepHours(int hours)` => `Future`
> Set sleep in hours.
- `sleepDays(int days)` => `Future`
Expand Down Expand Up @@ -86,6 +86,32 @@
- `randomColorHex()` => `String`
> Generate random color hex.
#### Kit RegExp

- `containsAlpha(String str)` => `bool`
> Check string contains alpha.
- `containsAlphaLowercase(String str)` => `bool`
> Check string contains alpha lowercase.
- `containsAlphaUppercase(String str)` => `bool`
> Check string contains alpha uppercase.
- `containsNumeric(String str)` => `bool`
> Check string contains numeric.
- `onlyAlpha(String str)` => `bool`
> Check string only alpha.
- `onlyAlphaLowercase(String str)` => `bool`
> Check string only alpha lowercase.
- `onlyAlphaUppercase(String str)` => `bool`
> Check string only alpha uppercase.
- `onlyNumeric(String str)` => `bool`
> Check string only numeric.
#### Kit Map

- `length` => `int`
Expand Down
24 changes: 16 additions & 8 deletions lib/regexpUtils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,57 @@ class _Regex {
}

class RegExpUtils {
containsAlpha(String str) {
/// Check string contains alpha.
bool containsAlpha(String str) {
RegExp reg = RegExp(_Regex().containsAlpha);

return reg.hasMatch(str);
}

containsAlphaLowercase(String str) {
/// Check string contains alpha lowercase.
bool containsAlphaLowercase(String str) {
RegExp reg = RegExp(_Regex().containsAlphaLowercase);

return reg.hasMatch(str);
}

containsAlphaUppercase(String str) {
/// Check string contains alpha uppercase.
bool containsAlphaUppercase(String str) {
RegExp reg = RegExp(_Regex().containsAlphaUppercase);

return reg.hasMatch(str);
}

containsNumeric(String str) {
/// Check string contains numeric.
bool containsNumeric(String str) {
RegExp reg = RegExp(_Regex().containsNumeric);

return reg.hasMatch(str);
}

onlyAlpha(String str) {
/// Check string only alpha.
bool onlyAlpha(String str) {
RegExp reg = RegExp(_Regex().onlyAlpha);

return reg.hasMatch(str);
}

onlyAlphaLowercase(String str) {
/// Check string only alpha lowercase.
bool onlyAlphaLowercase(String str) {
RegExp reg = RegExp(_Regex().onlyAlphaLowercase);

return reg.hasMatch(str);
}

onlyAlphaUppercase(String str) {
/// Check string only alpha lowercase.
bool onlyAlphaUppercase(String str) {
RegExp reg = RegExp(_Regex().onlyAlphaUppercase);

return reg.hasMatch(str);
}

onlyNumeric(String str) {
/// Check string only numeric.
bool onlyNumeric(String str) {
RegExp reg = RegExp(_Regex().onlyNumeric);

return reg.hasMatch(str);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: toolkit
description: Just a simple toolkit for dart and flutter. Some API are ready to help manipulate map, string, random, and sleep. Hopefully can be useful.
description: Just a simple toolkit for flutter. Some APIs are ready to help manipulate map, string, random, and sleep. Hopefully can be useful.
version: 0.1.0
homepage: https://github.com/ariefsn/dart-toolkit

Expand Down

0 comments on commit bade239

Please sign in to comment.