Skip to content

Commit 3824791

Browse files
author
Sumit401
committed
Initial Commit
1 parent a0a4d7d commit 3824791

File tree

18 files changed

+324
-127
lines changed

18 files changed

+324
-127
lines changed

android/app/build.gradle

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ apply plugin: 'com.android.application'
2626
apply plugin: 'kotlin-android'
2727
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2828

29+
def keystoreProperties = new Properties()
30+
def keystorePropertiesFile = rootProject.file('key.properties')
31+
if (keystorePropertiesFile.exists()) {
32+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
33+
}
34+
2935
android {
3036
compileSdkVersion 33
3137
ndkVersion flutter.ndkVersion
@@ -46,7 +52,7 @@ android {
4652

4753
defaultConfig {
4854
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
49-
applicationId "com.example.flutter_project"
55+
applicationId "com.sumit401.champquizz"
5056
// You can update the following values to match your application needs.
5157
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
5258
minSdkVersion 19
@@ -56,11 +62,17 @@ android {
5662
versionName flutterVersionName
5763
}
5864

65+
signingConfigs {
66+
release {
67+
keyAlias keystoreProperties['keyAlias']
68+
keyPassword keystoreProperties['keyPassword']
69+
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
70+
storePassword keystoreProperties['storePassword']
71+
}
72+
}
5973
buildTypes {
6074
release {
61-
// TODO: Add your own signing config for the release build.
62-
// Signing with the debug keys for now, so `flutter run --release` works.
63-
signingConfig signingConfigs.debug
75+
signingConfig signingConfigs.release
6476
}
6577
}
6678
}

android/app/google-services.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,35 @@
4141
]
4242
}
4343
}
44+
},
45+
{
46+
"client_info": {
47+
"mobilesdk_app_id": "1:575325391913:android:362c0c751ab8063553a038",
48+
"android_client_info": {
49+
"package_name": "com.sumit401.champquizz"
50+
}
51+
},
52+
"oauth_client": [
53+
{
54+
"client_id": "575325391913-ielo1h6md08b5h1ejdkob9dpoj5jlenh.apps.googleusercontent.com",
55+
"client_type": 3
56+
}
57+
],
58+
"api_key": [
59+
{
60+
"current_key": "AIzaSyA1OL4RDkiecwoOz9GpiXjcgh234ZRY8YA"
61+
}
62+
],
63+
"services": {
64+
"appinvite_service": {
65+
"other_platform_oauth_client": [
66+
{
67+
"client_id": "575325391913-ielo1h6md08b5h1ejdkob9dpoj5jlenh.apps.googleusercontent.com",
68+
"client_type": 3
69+
}
70+
]
71+
}
72+
}
4473
}
4574
],
4675
"configuration_version": "1"
-949 Bytes
Loading
-670 Bytes
Loading
Loading
Loading
Loading

lib/Faculty/createQuiz/submitQuizButton.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ Widget submitQuizButton() {
4242
"Difficulty": providerValue.stringForQuizDifficulty
4343
});
4444

45+
46+
await FirebaseFirestore.instance
47+
.collection("users")
48+
.doc(email)
49+
.update({
50+
"attempt": getDocsCount+1,
51+
});
52+
4553
// Set each Element from list to the Firebase Database.....................
4654
for (var element in providerValue.list) {
4755
i++;

lib/Faculty/navigationDrawer/drawerBody.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ ListTile listTileShare(context) {
187187
style: TextStyle(
188188
fontSize: setSize(context, 18), fontWeight: FontWeight.w400),
189189
),
190-
onTap: () {},
190+
onTap: () async {
191+
await launchUrlString(appLink,
192+
webOnlyWindowName: "App Share");
193+
Navigator.pop(context);
194+
195+
},
191196
);
192197
}
193198

lib/Student/assignedTeachers/teachersAssigned.dart

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,29 @@ Widget teachersAssigned(context) {
3535
));
3636
} else {
3737
// If not null create List View of the following ......................
38-
final validData = snapshot.data?.docs.where((d)=> d['userType']=="1" && d['about']!="").toList();
38+
final validData = snapshot.data?.docs
39+
.where((d) => d['userType'] == "1" && d['about'] != "" && d['attempt']> 0).toList();
40+
41+
3942

4043
return ResponsiveWidget.isSmallScreen(context)
4144
? ListView.builder(
4245
itemCount: validData?.length,
4346
itemBuilder: (context, index) {
44-
return cardWidget(validData, index,"List");
47+
return cardWidget(validData, index, "List");
4548
},
4649
)
4750
: GridView.builder(
48-
shrinkWrap: true,
51+
shrinkWrap: true,
4952
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
50-
crossAxisCount: ResponsiveWidget.isMediumScreen(context)
51-
? 2 : 3,
52-
mainAxisExtent: screenHeight(context) / 1.5),
53-
itemCount: validData?.length,
54-
itemBuilder: (context, index) {
55-
return cardWidget(validData, index,"Grid");
56-
},
57-
);
53+
crossAxisCount:
54+
ResponsiveWidget.isMediumScreen(context) ? 2 : 3,
55+
mainAxisExtent: screenHeight(context) / 1.5),
56+
itemCount: validData?.length,
57+
itemBuilder: (context, index) {
58+
return cardWidget(validData, index, "Grid");
59+
},
60+
);
5861
}
5962
},
6063
);

lib/Student/navigationDrawer/drawerBody.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ ListTile listTileShare(context) {
141141
style: TextStyle(
142142
fontSize: setSize(context, 17), fontWeight: FontWeight.w400),
143143
),
144-
onTap: () {},
144+
onTap: () async {
145+
String mailto =
146+
"mailto:[email protected]?subject=Query Regarding Quiz Application";
147+
await launchUrlString(mailto,
148+
mode: LaunchMode.externalApplication);
149+
},
145150
);
146151
}

lib/constants/constantString.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const String splashImg = "assets/images/splash_Image.png";
66
// String for Privacy Policy and Terms and Conditions...........................
77
const String privacyPolicyURL = "https://firebasestorage.googleapis.com/v0/b/project-41bc9.appspot.com/o/terms%20and%20conditions%2Fprivacy%20policy.html?alt=media&token=cf0065d8-7263-41b2-989a-4daf353b6a6a";
88
const String termsConditionsURL = "https://firebasestorage.googleapis.com/v0/b/project-41bc9.appspot.com/o/terms%20and%20conditions%2Fterms%20and%20conditions.html?alt=media&token=01d1ece9-8da7-4d9d-98a5-7ecb8ee26e95";
9+
const String appLink = "https://play.google.com/store/apps/details?id=com.sumit401.champquizz";
910

1011
// String for About Us Content........................................
1112
const String aboutUsContent =

lib/loginPage/textFields.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,21 @@ Widget textFieldEmail() {
1515
onChanged: (value) {
1616
providerValue.emailNotifier(value);
1717
},
18+
validator: (value) {
19+
const pattern = r"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$";
20+
if (value!.trimLeft().length < 3) {
21+
if (RegExp(r'[\s]').hasMatch(value)) {
22+
return "Email must not contain spaces";
23+
}
24+
return "Please enter a valid Email";
25+
} else if (!RegExp(pattern).hasMatch(value)) {
26+
return "Please enter a valid Email";
27+
}
28+
return null;
29+
},
30+
autovalidateMode: AutovalidateMode.onUserInteraction,
1831
style: textStyleLabel());
32+
1933
},
2034
));
2135
}
@@ -49,6 +63,10 @@ InputDecoration inputTextDecoration(String value) {
4963
focusColor: Colors.white,
5064
focusedBorder: textFieldBorder(),
5165
enabledBorder: textFieldBorder(),
66+
errorBorder: textFieldBorder(),
67+
focusedErrorBorder: textFieldBorder(),
68+
errorStyle: TextStyle(fontSize: 14),
69+
border: textFieldBorder(),
5270
);
5371
}
5472

lib/registerPage/submitButton.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ Future<void> setDataToFirebase(providerValue, context) async {
5555
result.user?.updateDisplayName(providerValue.name.trim());
5656

5757
// Map user data ................
58-
Map<String, String> userdata = {
58+
Map<String, dynamic> userdata = {
5959
"name": providerValue.name.trim(),
6060
"userType": providerValue.radioForStudentFaculty.toString(),
6161
"about": "",
6262
"experience": "",
6363
"qualification": "",
6464
"contact": "",
65+
"attempt" : 0,
6566
};
6667
// Set user data to collection in Firebase...........
6768
FirebaseFirestore.instance

lib/registerPage/textFields.dart

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,21 @@ Widget textFieldEmail() {
2626
return Consumer<RegisterPageProvider>(
2727
builder: (context, providerValue, child) {
2828
return Container(
29-
margin: EdgeInsets.symmetric(vertical: 10),
29+
margin: const EdgeInsets.symmetric(vertical: 10),
3030
child: TextFormField(
31+
validator: (value) {
32+
const pattern = r"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$";
33+
if (value!.trimLeft().length < 3) {
34+
if (RegExp(r'[\s]').hasMatch(value)) {
35+
return "Email must not contain spaces";
36+
}
37+
return "Please enter a valid Email";
38+
} else if (!RegExp(pattern).hasMatch(value)) {
39+
return "Please enter a valid Email";
40+
}
41+
return null;
42+
},
43+
autovalidateMode: AutovalidateMode.onUserInteraction,
3144
style: const TextStyle(color: Colors.white),
3245
keyboardType: TextInputType.emailAddress,
3346
decoration: textFieldDecoration("Email"),
@@ -63,6 +76,10 @@ InputDecoration textFieldDecoration(String label) {
6376
return InputDecoration(
6477
labelText: label,
6578
labelStyle: const TextStyle(color: Colors.white),
79+
errorBorder: textFieldBorder(),
80+
focusedErrorBorder: textFieldBorder(),
81+
errorStyle: TextStyle(fontSize: 14),
82+
border: textFieldBorder(),
6683
enabledBorder: textFieldBorder(),
6784
focusedBorder: textFieldBorder());
6885
}

lib/reusableWidgets/profileSection/profilePageContent/dialogBoxUpdateDatabase.dart

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,27 @@ import 'package:provider/provider.dart';
66
import '../../Responsive.dart';
77
import '../provider.dart';
88

9+
final formKey = GlobalKey<FormState>();
910
createDialogBoxUpdate(context, providerValue, updateValue) {
1011
showDialog(
1112
context: context,
1213
builder: (context) {
1314
return AlertDialog(
15+
scrollable: true,
1416
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
1517
title: Text(updateValue),
16-
content: contentOfAlertBox(context, providerValue, updateValue),
17-
actions: [buttonForSave()],
18-
actionsPadding: EdgeInsets.only(
19-
right: setSize(context, 20), bottom: setSize(context, 20)),
18+
content: Form(
19+
key: formKey,
20+
child: Column(
21+
crossAxisAlignment: CrossAxisAlignment.end,
22+
mainAxisAlignment: MainAxisAlignment.center,
23+
children: [
24+
contentOfAlertBox(context, providerValue, updateValue),
25+
const SizedBox(height: 10),
26+
buttonForSave(formKey)
27+
],
28+
),
29+
),
2030
);
2131
},
2232
);
@@ -42,6 +52,13 @@ contentOfAlertBox(context, providerValue, updateValue) {
4252
decoration: InputDecoration(
4353
counterText: "",
4454
border: OutlineInputBorder(borderRadius: BorderRadius.circular(20))),
55+
56+
validator: updateValue == "Phone" ? (value) {
57+
if(value?.length != 10) {
58+
return "Please enter valid mobile number";
59+
}
60+
} : null,
61+
autovalidateMode: AutovalidateMode.onUserInteraction,
4562
maxLines: updateValue != "Phone" ? 10 : 1,
4663
minLines: 1,
4764
maxLength: updateValue == "Phone" ? 10 : 500,
@@ -59,24 +76,27 @@ contentOfAlertBox(context, providerValue, updateValue) {
5976
}
6077

6178
// Button To update...................................
62-
buttonForSave() {
79+
buttonForSave(GlobalKey<FormState> formKey) {
6380
return Consumer<ProfilePageProvider>(
6481
builder: (context, proValue, child) {
6582
return ElevatedButton(
6683
onPressed: () {
67-
String? email = FirebaseAuth.instance.currentUser?.email.toString();
84+
if (formKey.currentState!.validate()) {
85+
String? email = FirebaseAuth.instance.currentUser?.email
86+
.toString();
6887

69-
Map<String, String> updatedData = {
70-
"about": proValue.about,
71-
"experience": proValue.experience,
72-
"qualification": proValue.qualification,
73-
"contact": proValue.userPhone,
74-
};
75-
FirebaseFirestore.instance
76-
.collection("users")
77-
.doc(email)
78-
.update(updatedData);
79-
Navigator.pop(context);
88+
Map<String, String> updatedData = {
89+
"about": proValue.about,
90+
"experience": proValue.experience,
91+
"qualification": proValue.qualification,
92+
"contact": proValue.userPhone,
93+
};
94+
FirebaseFirestore.instance
95+
.collection("users")
96+
.doc(email)
97+
.update(updatedData);
98+
Navigator.pop(context);
99+
}
80100
},
81101
child: const Text("Save"));
82102
},

0 commit comments

Comments
 (0)