Skip to content

Commit

Permalink
refactor: cont. maintain project
Browse files Browse the repository at this point in the history
  • Loading branch information
princ3od committed Mar 13, 2023
1 parent 1dec15e commit 257177c
Show file tree
Hide file tree
Showing 28 changed files with 656 additions and 361 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.famereani.tutor_time"
applicationId "com.example.ajent"
minSdkVersion 21
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
Expand Down
23 changes: 11 additions & 12 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
{
"project_info": {
"project_number": "500465937950",
"firebase_url": "https://tutor-time-1183f-default-rtdb.firebaseio.com",
"project_id": "tutor-time-1183f",
"storage_bucket": "tutor-time-1183f.appspot.com"
"project_number": "930529302228",
"project_id": "ajent-6ca5a",
"storage_bucket": "ajent-6ca5a.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:500465937950:android:4613d1b06ee711780dc80f",
"mobilesdk_app_id": "1:930529302228:android:58d3ab0afbcf701c6acd41",
"android_client_info": {
"package_name": "com.famereani.tutor_time"
"package_name": "com.example.ajent"
}
},
"oauth_client": [
{
"client_id": "500465937950-8dp64r5tgsd5t36vdh79h26pt9enrjuu.apps.googleusercontent.com",
"client_id": "930529302228-1u2aafi0m55q6ugbng4l7n2tvc0c0ta6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.famereani.tutor_time",
"certificate_hash": "6fbbbf142d8ac2865f6f0ddbdb6982dd577a3c8c"
"package_name": "com.example.ajent",
"certificate_hash": "c804d02a70569e8eb3734d57e0cd51638beaf452"
}
},
{
"client_id": "500465937950-hf27h33d1q1mi7tbdo0tan7cglon0n13.apps.googleusercontent.com",
"client_id": "930529302228-7lk0kan5racred9c9ub9sltmeb6jncaj.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBztk8gyY95S_X7KxHLH5BKufBTqqGphKQ"
"current_key": "AIzaSyAzYETSLdACJe8onb-BP2A_ild8JU1M2a8"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "500465937950-hf27h33d1q1mi7tbdo0tan7cglon0n13.apps.googleusercontent.com",
"client_id": "930529302228-7lk0kan5racred9c9ub9sltmeb6jncaj.apps.googleusercontent.com",
"client_type": 3
}
]
Expand Down
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.famereani.tutor_time">
package="com.example.ajent">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
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.famereani.tutor_time">
package="com.example.ajent">
<application
android:label="Ajent"
android:icon="@mipmap/ic_launcher">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.famereani.tutor_time
package com.example.ajent

import io.flutter.embedding.android.FlutterActivity

Expand Down
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.famereani.tutor_time">
package="com.example.ajent">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
8 changes: 8 additions & 0 deletions lib/app/global_widgets/course_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ class CourseCard extends StatelessWidget {
image: course.photoUrl,
width: 100,
fit: BoxFit.fitWidth,
imageErrorBuilder:
(context, error, stackTrace) {
return Image.asset(
'assets/images/ajent_logo.png',
width: 100,
fit: BoxFit.fitWidth,
);
},
),
),
radius: 30.0,
Expand Down
8 changes: 8 additions & 0 deletions lib/app/global_widgets/teaching_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ class TeachingCard extends StatelessWidget {
image: course.photoUrl,
width: 100,
fit: BoxFit.fitWidth,
imageErrorBuilder:
(context, error, stackTrace) {
return Image.asset(
'assets/images/ajent_logo.png',
width: 100,
fit: BoxFit.fitWidth,
);
},
),
),
radius: 30.0,
Expand Down
5 changes: 4 additions & 1 deletion lib/app/modules/add_course/add_course_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:textfield_tags/textfield_tags.dart';

class AddCourseController extends GetxController {
List<String> subjects = [];
Expand All @@ -41,6 +42,8 @@ class AddCourseController extends GetxController {
TextEditingController txtCoursePrice = TextEditingController();
TextEditingController txtCourseAddress = TextEditingController();
TextEditingController txtCourseRequirements = TextEditingController();
TextfieldTagsController tagsController = TextfieldTagsController();

var imagePath = ''.obs;

var isAddingCourse = false.obs;
Expand Down Expand Up @@ -77,7 +80,7 @@ class AddCourseController extends GetxController {
..timeType = selectedTimeType.value
..requirements = txtCourseRequirements.text
..photoUrl = imageUrl
..subjects = subjects;
..subjects = tagsController.getTags;
if (course.maxLearner < 1 || course.price < 50000) {
Get.snackbar("data_error".tr, "check_course_info_warning".tr);
isAddingCourse.value = false;
Expand Down
123 changes: 77 additions & 46 deletions lib/app/modules/add_course/widgets/OverviewPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import 'dart:io';
import 'package:ajent/app/modules/add_course/add_course_controller.dart';
import 'package:ajent/core/themes/widget_theme.dart';
import 'package:ajent/core/values/colors.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:textfield_tags/textfield_tags.dart';

class OverviewPage extends StatelessWidget {
OverviewPage({Key key}) : super(key: key);
final AddCourseController controller = Get.put(AddCourseController(Get.arguments));
final AddCourseController controller =
Get.put(AddCourseController(Get.arguments));

@override
Widget build(BuildContext context) {
return Align(
Expand All @@ -30,15 +31,15 @@ class OverviewPage extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Obx(
() => (controller.imagePath.isEmpty)
() => (controller.imagePath.isEmpty)
? Image(
image: AssetImage(
'assets/images/no_img.png'),
)
image:
AssetImage('assets/images/no_img.png'),
)
: Image.file(
File(controller.imagePath.value),
fit: BoxFit.cover,
),
File(controller.imagePath.value),
fit: BoxFit.cover,
),
),
),
),
Expand Down Expand Up @@ -95,49 +96,79 @@ class OverviewPage extends StatelessWidget {
height: 10,
),
TextFieldTags(
tagsStyler: TagsStyler(
showHashtag: true,
tagMargin: const EdgeInsets.only(right: 4.0),
tagCancelIcon:
Icon(Icons.cancel, size: 15.0, color: Colors.white),
tagCancelIconPadding: EdgeInsets.only(left: 4.0, top: 2.0),
tagPadding:
EdgeInsets.only(top: 2.0, bottom: 4.0, left: 8.0, right: 4.0),
tagDecoration: BoxDecoration(
color: primaryColor,
border: Border.all(
color: Colors.white,
),
borderRadius: const BorderRadius.all(
Radius.circular(20.0),
),
),
tagTextStyle:
TextStyle(fontWeight: FontWeight.normal, color: Colors.white),
),
textFieldStyler: TextFieldStyler(
helperText: null,
hintText: "Tags",
textStyle: GoogleFonts.nunitoSans(),
isDense: false,
textFieldBorder: null,
textFieldFocusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor, width: 1.0),
),
),
onDelete: (tag) {
controller.subjects.remove(tag);
print(controller.subjects);
},
onTag: (tag) {
controller.subjects.add(tag);
},
textfieldTagsController: controller.tagsController,
validator: (String tag) {
if (tag.length > 10) {
return "too_long_tag_warning".tr;
}
return null;
},
textSeparators: const [','],
inputfieldBuilder: (context, txtController, focusNode, error,
onChanged, onSubmitted) {
return ((context, scrollController, tags, onTagDelete) {
return TextField(
controller: txtController,
focusNode: focusNode,
decoration: InputDecoration(
helperText: "Tags should be separated by commas".tr,
hintText: tags.isEmpty ? "Tags".tr : "",
errorText: error,
prefixIcon: tags.isNotEmpty
? SingleChildScrollView(
controller: scrollController,
scrollDirection: Axis.horizontal,
child: Row(
children: tags.map((String tag) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
color: primaryColor,
),
margin: const EdgeInsets.symmetric(
horizontal: 5.0),
padding: const EdgeInsets.symmetric(
horizontal: 10.0, vertical: 5.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Text(
'#$tag',
style: const TextStyle(
color: Colors.white),
),
onTap: () {
print("$tag selected");
},
),
const SizedBox(width: 4.0),
InkWell(
child: const Icon(
Icons.cancel,
size: 14.0,
color: Color.fromARGB(
255, 233, 233, 233),
),
onTap: () {
onTagDelete(tag);
},
)
],
),
);
}).toList()),
)
: null,
),
onChanged: onChanged,
onSubmitted: onSubmitted,
);
});
},
),
],
),
Expand Down
27 changes: 17 additions & 10 deletions lib/app/modules/chat/widgets/invitation_course_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,23 @@ class InvitationCourseCard extends StatelessWidget {
child: CircleAvatar(
child: ClipOval(
child: FadeInImage.assetNetwork(
fadeInDuration:
Duration(milliseconds: 200),
fadeOutDuration:
Duration(milliseconds: 180),
placeholder:
'assets/images/ajent_logo.png',
image: course?.photoUrl ?? "",
width: 80,
fit: BoxFit.fitWidth,
),
fadeInDuration:
Duration(milliseconds: 200),
fadeOutDuration:
Duration(milliseconds: 180),
placeholder:
'assets/images/ajent_logo.png',
image: course?.photoUrl ?? "",
width: 80,
fit: BoxFit.fitWidth,
imageErrorBuilder:
(context, error, stackTrace) {
return Image.asset(
'assets/images/ajent_logo.png',
width: 80,
fit: BoxFit.fitWidth,
);
}),
),
radius: 20,
),
Expand Down
3 changes: 3 additions & 0 deletions lib/app/modules/chat/widgets/message_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class MessageItem extends StatelessWidget {
image: message.content,
fadeInDuration: Duration(milliseconds: 300),
fadeOutDuration: Duration(milliseconds: 300),
imageErrorBuilder: (context, error, stackTrace) {
return Image.asset('assets/images/no_img.png');
},
),
),
),
Expand Down
4 changes: 3 additions & 1 deletion lib/app/modules/edit_course/edit_course_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:ajent/routes/pages.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:textfield_tags/textfield_tags.dart';

class EditCourseController extends GetxController {
var subjects = <String>[].obs;
Expand All @@ -38,6 +39,7 @@ class EditCourseController extends GetxController {
TextEditingController txtCoursePrice = TextEditingController();
TextEditingController txtCourseAddress = TextEditingController();
TextEditingController txtCourseRequirements = TextEditingController();
TextfieldTagsController tagsController = TextfieldTagsController();

var isUpdating = false.obs;

Expand Down Expand Up @@ -79,7 +81,7 @@ class EditCourseController extends GetxController {
..timeType = selectedTimeType.value
..requirements = txtCourseRequirements.text
..photoUrl = course.photoUrl ?? ""
..subjects = subjects;
..subjects = tagsController.getTags;
if (course.maxLearner < course.learners.length || course.price < 50000) {
Get.snackbar("data_error".tr, "check_course_info_warning".tr);
isUpdating.value = false;
Expand Down

0 comments on commit 257177c

Please sign in to comment.