v1 release
This commit is contained in:
commit
cb24b68069
116 changed files with 4913 additions and 0 deletions
12
lib/shared/utils/random_color.dart
Normal file
12
lib/shared/utils/random_color.dart
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import "dart:math";
|
||||
import "dart:ui";
|
||||
|
||||
Color getRandomColor() {
|
||||
Random random = Random();
|
||||
return Color.fromRGBO(
|
||||
random.nextInt(256),
|
||||
random.nextInt(256),
|
||||
random.nextInt(256),
|
||||
1,
|
||||
);
|
||||
}
|
||||
12
lib/shared/utils/random_string.dart
Normal file
12
lib/shared/utils/random_string.dart
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import "dart:math";
|
||||
|
||||
String randomString(int length) {
|
||||
const charset =
|
||||
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
final random = Random.secure();
|
||||
final codeUnits = List<int>.generate(
|
||||
length,
|
||||
(index) => charset.codeUnitAt(random.nextInt(charset.length)),
|
||||
);
|
||||
return String.fromCharCodes(codeUnits);
|
||||
}
|
||||
3
lib/shared/utils/regex_patterns.dart
Normal file
3
lib/shared/utils/regex_patterns.dart
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
final RegExp emailRegex = RegExp(
|
||||
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$',
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue