Skip to content

Commit

Permalink
Final fix
Browse files Browse the repository at this point in the history
princ3od committed Jul 8, 2021
1 parent 3826de7 commit ddfb663
Showing 15 changed files with 37 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ An app bridges the Gap between Tutors and Learners ./
- Enjoy!

---
- Or get the **[APK](https://apkfab.com/ajent/com.tneja.ajent/apk)**
- Or get the **[APK](https://apkfab.com/ajent/com.example.ajent/apk)**
## Authors

- [Dương Bình Trọng - 19521056](https://www.github.com/princ3od)
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.tneja.ajent"
applicationId "com.example.ajent"
minSdkVersion 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
4 changes: 2 additions & 2 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -9,15 +9,15 @@
"client_info": {
"mobilesdk_app_id": "1:930529302228:android:58d3ab0afbcf701c6acd41",
"android_client_info": {
"package_name": "com.tneja.ajent"
"package_name": "com.example.ajent"
}
},
"oauth_client": [
{
"client_id": "930529302228-1u2aafi0m55q6ugbng4l7n2tvc0c0ta6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.tneja.ajent",
"package_name": "com.example.ajent",
"certificate_hash": "c804d02a70569e8eb3734d57e0cd51638beaf452"
}
},
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tneja.ajent">
package="com.example.ajent">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tneja.ajent">
package="com.example.ajent">
<application
android:label="Ajent"
android:icon="@mipmap/ic_launcher">
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tneja.ajent
package com.example.ajent

import io.flutter.embedding.android.FlutterActivity

2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tneja.ajent">
package="com.example.ajent">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -291,7 +291,7 @@
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tneja.ajent;
PRODUCT_BUNDLE_IDENTIFIER = com.example.ajent;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@@ -415,7 +415,7 @@
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tneja.ajent;
PRODUCT_BUNDLE_IDENTIFIER = com.example.ajent;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -434,7 +434,7 @@
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tneja.ajent;
PRODUCT_BUNDLE_IDENTIFIER = com.example.ajent;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
8 changes: 6 additions & 2 deletions lib/app/modules/add_course/add_course_controller.dart
Original file line number Diff line number Diff line change
@@ -78,9 +78,13 @@ class AddCourseController extends GetxController {
..requirements = txtCourseRequirements.text
..photoUrl = imageUrl
..subjects = subjects;
if (course.maxLearner < 1 || course.price < 50000) {
Get.snackbar("data_error".tr, "check_course_info_warning".tr);
isAddingCourse.value = false;
return;
}
} catch (e) {
Get.snackbar(
"data_error".tr, "check_course_info_warning".tr);
Get.snackbar("data_error".tr, "check_course_info_warning".tr);
isAddingCourse.value = false;
return;
}
1 change: 1 addition & 0 deletions lib/app/modules/auth/auth_controller.dart
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ class AuthController extends GetxController {
"",
);
HomeController.mainUser = await UserService.instance.addUser(ajentUser);
HomeController.mainUser.degrees = [];
await SubscribeService.instance.subscribeOnLogin(user.uid);
} else {
HomeController.mainUser = await UserService.instance.getUser(user.uid);
5 changes: 5 additions & 0 deletions lib/app/modules/edit_course/edit_course_controller.dart
Original file line number Diff line number Diff line change
@@ -80,6 +80,11 @@ class EditCourseController extends GetxController {
..requirements = txtCourseRequirements.text
..photoUrl = course.photoUrl ?? ""
..subjects = subjects;
if (course.maxLearner < course.learners.length || course.price < 50000) {
Get.snackbar("data_error".tr, "check_course_info_warning".tr);
isUpdating.value = false;
return;
}
} catch (e) {
print(e);
Get.snackbar("data_error".tr, "check_course_info_warning".tr);
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:get/get.dart';

class TeachingCalendarEventCard extends StatelessWidget {
final Course course;

@@ -77,7 +78,9 @@ class TeachingCalendarEventCard extends StatelessWidget {
child: Row(
children: [
Flexible(
child: Text(course.maxLearner.toString()+"students".tr,
child: Text(
"${course.maxLearner.toString()} " +
"students".tr,
overflow: TextOverflow.ellipsis,
style: GoogleFonts.nunitoSans(
fontWeight: FontWeight.w700,
Original file line number Diff line number Diff line change
@@ -97,7 +97,8 @@ class MyCourseDetailController extends GetxController {
unEnrollable.value = (course.value.status == CourseStatus.upcoming &&
(course.value.learners.contains(HomeController.mainUser.uid) &&
course.value.owner != HomeController.mainUser.uid));
requestable.value = (joinable.value &&
requestable.value = (course.value.status == CourseStatus.upcoming &&
!course.value.learners.contains(HomeController.mainUser.uid) &&
course.value.owner != HomeController.mainUser.uid &&
!requestors.contains(user.uid) &&
(!course.value.hasTeacher()));
3 changes: 2 additions & 1 deletion lib/app/modules/my_profile/my_profile_controller.dart
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ class MyProfileController extends GetxController {
var tabIndex = 0.obs;
var ajentUser = HomeController.mainUser.obs;
var dropdownValue = ''.obs;
var startDate = DateTime.now().obs;
var startDate = HomeController.mainUser.birthDay.obs;
var ajenGender = HomeController.mainUser.gender.obs;
var ajenDegree = HomeController.mainUser.degrees.obs;

@@ -152,6 +152,7 @@ class MyProfileController extends GetxController {
Future<bool> updateInformation() async {
isUpdatingInfo.value = true;
AjentUser ajentUser = HomeController.mainUser;
ajentUser.birthDay = startDate.value;
ajentUser.name = txtName.text;
ajentUser.mail = txtMail.text;
ajentUser.schoolName = txtSchool.text;
12 changes: 6 additions & 6 deletions lib/app/modules/request/widgets/request_card.dart
Original file line number Diff line number Diff line change
@@ -117,12 +117,12 @@ class RequestCard extends StatelessWidget {
size: 16,
),
),
InkWell(
onTap: () async {
Get.toNamed(Routes.PROFILEVIEW,
arguments: data.requestor);
},
child: Flexible(
Flexible(
child: InkWell(
onTap: () {
Get.toNamed(Routes.PROFILEVIEW,
arguments: data.requestor);
},
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,

0 comments on commit ddfb663

Please sign in to comment.