Skip to content

Commit

Permalink
refactor: move regex_helper func to deriv_ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrar-deriv committed Nov 16, 2023
1 parent cd878b5 commit 310d2ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 100 deletions.
94 changes: 0 additions & 94 deletions packages/deriv_auth_ui/lib/src/core/helpers/regex_helper.dart

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:deriv_auth_ui/src/core/extensions/context_extension.dart';
import 'package:deriv_auth_ui/src/core/helpers/endpoint_helper.dart';
import 'package:deriv_auth_ui/src/core/helpers/regex_helper.dart';
import 'package:deriv_theme/deriv_theme.dart';
import 'package:deriv_ui/utils/regex_helpers.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';

Expand Down
12 changes: 7 additions & 5 deletions packages/deriv_auth_ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ dependencies:
url: [email protected]:regentmarkets/flutter-deriv-packages.git
path: packages/deriv_theme
ref: dev
# TODO(@ahrar-deriv): replace after merge commit PR 314
deriv_ui:
git:
url: [email protected]:sahani-deriv/flutter-deriv-packages.git
path: packages/deriv_ui
ref: auth-ui-update

path: ../deriv_ui
# git:
# url: [email protected]:sahani-deriv/flutter-deriv-packages.git
# path: packages/deriv_ui
# ref: auth-ui-update
#
flutter_svg: ^1.1.6
smooth_page_indicator: ^1.1.0
intl_utils: ^2.8.3
Expand Down
7 changes: 7 additions & 0 deletions packages/deriv_ui/lib/utils/regex_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ RegExp validPasswordLengthRegex = RegExp(r'^.{8,25}$');

/// Valid Password length for login.
RegExp validLoginPasswordLengthRegex = RegExp(r'^.{6,25}$');

/// Check if [str] input contains only a-z letters and 0-9 numbers
bool hasOnlySmallLettersAndNumberInput(String str) =>
RegExp('^[a-z0-9.]+\$').hasMatch(str);

/// Check if [string] input contains only 0-9 numbers
bool hasOnlyNumberInput(String string) => RegExp('^[0-9]+\$').hasMatch(string);

0 comments on commit 310d2ab

Please sign in to comment.