Skip to content

Commit ac16b6c

Browse files
feat: Add signup screen.
feat: Add signup screen.
2 parents 87101ba + c7237b4 commit ac16b6c

41 files changed

Lines changed: 1746 additions & 119 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
java-version: '12.x'
1818
- uses: subosito/flutter-action@v1
1919
with:
20+
flutter-version: "2.10.0"
2021
channel: "stable"
2122

2223
# Prepare Flutter
@@ -41,6 +42,7 @@ jobs:
4142
java-version: '12.x'
4243
- uses: subosito/flutter-action@v1
4344
with:
45+
flutter-version: "2.10.0"
4446
channel: "stable"
4547

4648
# Prepare Flutter
@@ -63,6 +65,7 @@ jobs:
6365
java-version: '12.x'
6466
- uses: subosito/flutter-action@v1
6567
with:
68+
flutter-version: "2.10.0"
6669
channel: "stable"
6770

6871
# Prepare Flutter

android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
<category android:name="android.intent.category.LAUNCHER"/>
3434
</intent-filter>
3535
</activity>
36-
<!-- Don't delete the meta-data below.
36+
<activity
37+
android:name="com.yalantis.ucrop.UCropActivity"
38+
android:screenOrientation="portrait"
39+
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
40+
<!-- Don't delete the meta-data below.
3741
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
3842
<meta-data
3943
android:name="flutterEmbedding"
Lines changed: 3 additions & 0 deletions
Loading
39.8 KB
Loading

lib/data/constants/assets.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ class AppAssets {
66
static const String _platformIconRoot = '$_imagesRoot/platforms';
77

88
// Icons
9+
static const String arrowBackward = '$_iconsRoot/arrow-backward.svg';
910
static const String arrowForward = '$_iconsRoot/arrow-forward.svg';
11+
static const String defaultUserIcon = '$_iconsRoot/default_user_icon.svg';
1012
static const String eyeOn = '$_iconsRoot/eye-on.svg';
1113
static const String eyeOff = '$_iconsRoot/eye-off.svg';
1214
static const String lock = '$_iconsRoot/lock.svg';
@@ -31,17 +33,18 @@ class AppAssets {
3133
'$_illustrationsRoot/feed_card.png';
3234
static const String profileIllustration = '$_illustrationsRoot/profile.png';
3335

34-
/// BottomNavigationBar Icons
36+
// BottomNavigationBar Icons
3537
static const String feed = '$_iconsRoot/feed.svg';
3638
static const String contest = '$_iconsRoot/contest.svg';
3739
static const String search = '$_iconsRoot/search.svg';
3840
static const String profile = '$_iconsRoot/profile.svg';
3941

40-
/// Platform Icons
42+
// Platform icons
4143
static const String codechef = '$_platformIconRoot/codechef.png';
4244
static const String codeforces = '$_platformIconRoot/codeforces.png';
4345
static const String hackerRank = '$_platformIconRoot/hacker_rank.png';
4446
static const String hackerEarth = '$_platformIconRoot/hacker_earth.png';
4547
static const String spoj = '$_platformIconRoot/spoj.png';
48+
static const String leetCode = '$_platformIconRoot/leetcode.png';
4649
static const String otherPlatform = '$_platformIconRoot/other_platform.jpg';
4750
}

lib/data/constants/colors.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ class AppColors {
1414

1515
static const Color primary = Color(0xFF3366FF);
1616
static const Color primaryAccent = Color(0x0D3366FF);
17-
static const Color primaryBlack = Color(0xFF242424);
1817
}

lib/data/constants/routes.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class AppRoutes {
77
static const String login = '/login';
88
static const String signUp = '/signup';
99
static const String onboarding = '/onboarding';
10+
static const String verify = '/verify';
1011

1112
// Post-Auth
1213
static const String home = '/home';

lib/data/constants/strings.dart

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,30 @@ class AppStrings {
77
static const String recentSearchKey = 'recent_search';
88

99
// Error
10+
static const String similarUserExists = 'This user already exists. '
11+
'Please choose different email or username.';
1012
static const String genericError = 'Something went wrong';
1113
static const String incorrectCredentials = 'Incorrect credentials';
14+
static const String duplicateEmail =
15+
'This email is already in use. Use another email or log in';
1216
static const String noUserWithEmail =
1317
'No user associated with given email address';
1418
static const String passwordResetSuccess =
15-
'Success! Please check your email for a password reset link';
19+
'Successful! Please check your email for a password reset link';
20+
static const String signUpSuccess =
21+
'You are almost done with the sign up process. '
22+
'Please check your email to verify this account';
23+
static const String duplicateUsername =
24+
'This username is already in use. Choose another username or log in';
1625
static const String verifyFirst =
17-
'Please verify your email before attempting to log in\n'
26+
'Please verify your email before attempting to log in. '
1827
'Check your email for the verification link';
28+
static const String wrongFormValues =
29+
'Please fill all required values in the form correctly';
30+
31+
// Misc.
32+
static const String emailValidationRegex =
33+
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))'
34+
r'@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|'
35+
r'(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
1936
}

lib/data/constants/styles.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AppStyles {
1515
fontWeight: FontWeight.w900,
1616
);
1717
static final TextStyle h4 = TextStyle(
18-
color: AppColors.primaryBlack,
18+
color: AppColors.grey3,
1919
fontSize: 18.sp,
2020
fontWeight: FontWeight.w500,
2121
);
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import 'dart:io';
2+
3+
import 'package:image_cropper/image_cropper.dart';
4+
import 'package:image_picker/image_picker.dart';
5+
6+
/// Uses [ImagePicker] and [ImageCropper] packages to pick and crop a photo from the phone gallery
7+
class ImageService {
8+
/// Service initializer
9+
static void init() {
10+
_imagePicker = ImagePicker();
11+
_imageCropper = ImageCropper();
12+
}
13+
14+
// Data
15+
/// The [ImagePicker] instance which is used to access the image methods.
16+
static late final ImagePicker _imagePicker;
17+
18+
/// The [ImageCropper] instance which is used to access the image methods.
19+
static late final ImageCropper _imageCropper;
20+
21+
// Methods
22+
/// Allows the user to pick and crop a picture to use as their profile image.
23+
static Future<File?> pickProfileImage() async {
24+
final image = await _imagePicker.pickImage(source: ImageSource.gallery);
25+
26+
if (image == null) return null;
27+
28+
final croppedImage = await _imageCropper.cropImage(
29+
sourcePath: image.path,
30+
aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1),
31+
compressQuality: 100,
32+
maxHeight: 1000,
33+
maxWidth: 1000,
34+
compressFormat: ImageCompressFormat.png,
35+
);
36+
return croppedImage;
37+
}
38+
}

0 commit comments

Comments
 (0)