refactoring and ui colorization
This commit is contained in:
parent
29d7378e93
commit
2059193ce7
|
|
@ -19,7 +19,7 @@ extension Code on Languages {
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppColors {
|
class AppColors {
|
||||||
static Color sentMessageColor = const Color(0xffDAC439);
|
static Color sentMessageColor = const Color(0xff7986ca);
|
||||||
static Color primeColor = const Color(0xff7986ca);
|
static Color primeColor = const Color(0xff7986ca);
|
||||||
static Color tailAuthColor = const Color(0xffFEE64B);
|
static Color tailAuthColor = const Color(0xffFEE64B);
|
||||||
static Color textButtonColor = const Color(0xff484848);
|
static Color textButtonColor = const Color(0xff484848);
|
||||||
|
|
@ -56,10 +56,6 @@ class AppColors {
|
||||||
// static Color redColor = const Color(0xffFF8078);
|
// static Color redColor = const Color(0xffFF8078);
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppAssets {
|
|
||||||
static String logo = "assets/images/logo.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
class AppFont {
|
class AppFont {
|
||||||
static String bold = 'bold';
|
static String bold = 'bold';
|
||||||
static String regular = 'regular';
|
static String regular = 'regular';
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ class RxViewer extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Wifi Lottie.json',
|
'assets/animations/Wifi.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
width: 120,
|
width: 120,
|
||||||
).paddingAll(5),
|
).paddingAll(5),
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,7 @@ class Request {
|
||||||
this.method, {
|
this.method, {
|
||||||
this.authorized = false,
|
this.authorized = false,
|
||||||
this.removeMockMatch = false,
|
this.removeMockMatch = false,
|
||||||
this.isFormData =
|
this.isFormData = false,
|
||||||
false, // TODO: formData should be handled in different way.
|
|
||||||
this.headers,
|
this.headers,
|
||||||
this.cacheable = false,
|
this.cacheable = false,
|
||||||
this.body,
|
this.body,
|
||||||
|
|
@ -91,7 +90,6 @@ class Request {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode! >= 200 && response.statusCode! < 300) {
|
if (response.statusCode! >= 200 && response.statusCode! < 300) {
|
||||||
//TODO: this should be handled in different way.
|
|
||||||
if (response.data is String) return json.decode(response.data);
|
if (response.data is String) return json.decode(response.data);
|
||||||
if (method == RequestMethod.get && cacheable) {
|
if (method == RequestMethod.get && cacheable) {
|
||||||
await CacheService.cacheRequest(
|
await CacheService.cacheRequest(
|
||||||
|
|
@ -100,30 +98,31 @@ class Request {
|
||||||
|
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
} on DioError catch (error) {
|
} on DioException catch (error) {
|
||||||
// handling http status code exceptions
|
// handling http status code exceptions
|
||||||
if (error.type == DioErrorType.badResponse) {
|
if (error.type == DioExceptionType.badResponse) {
|
||||||
// handling bad requests.
|
// handling bad requests.
|
||||||
if (error.response!.statusCode == 400) {
|
if (error.response!.statusCode == 400) {
|
||||||
// this line is really depends on what server responds, and how it reply with errors.
|
// this line is really depends on what server responds, and how it reply with errors.
|
||||||
throw badRequestException[error.response!.data["error"]] ??
|
throw badRequestException[error.response!.data["error"]] ??
|
||||||
GenericException(
|
GenericException(
|
||||||
type: ExceptionType.Other,
|
type: ExceptionType.other,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// handling other status codes.
|
// handling other status codes.
|
||||||
throw statusCodesException[error.response!.statusCode] ??
|
throw statusCodesException[error.response!.statusCode] ??
|
||||||
GenericException(
|
GenericException(
|
||||||
type: ExceptionType.Other,
|
type: ExceptionType.other,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// handling connection problems.
|
// handling connection problems.
|
||||||
if (error.type == DioErrorType.connectionTimeout ||
|
if (error.type == DioExceptionType.connectionError ||
|
||||||
error.type == DioErrorType.sendTimeout ||
|
error.type == DioExceptionType.connectionTimeout ||
|
||||||
error.type == DioErrorType.receiveTimeout ||
|
error.type == DioExceptionType.sendTimeout ||
|
||||||
error.type == DioErrorType.unknown) {
|
error.type == DioExceptionType.receiveTimeout ||
|
||||||
|
error.type == DioExceptionType.unknown) {
|
||||||
if (method == RequestMethod.get && cacheable) {
|
if (method == RequestMethod.get && cacheable) {
|
||||||
onConnectionError?.call(error);
|
onConnectionError?.call(error);
|
||||||
Map<String, dynamic>? lastResponse =
|
Map<String, dynamic>? lastResponse =
|
||||||
|
|
@ -133,7 +132,7 @@ class Request {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw GenericException(
|
throw GenericException(
|
||||||
type: ExceptionType.ConnectionError,
|
type: ExceptionType.connectionError,
|
||||||
errorMessage: "You Have no Internet Connection",
|
errorMessage: "You Have no Internet Connection",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@ extension Converter on Socket {
|
||||||
String eventName,
|
String eventName,
|
||||||
dynamic body, {
|
dynamic body, {
|
||||||
void Function(dynamic)? ack,
|
void Function(dynamic)? ack,
|
||||||
})
|
}) func,
|
||||||
func,
|
|
||||||
) {
|
) {
|
||||||
Completer completer = Completer();
|
Completer completer = Completer();
|
||||||
|
|
||||||
|
|
@ -26,7 +25,7 @@ extension Converter on Socket {
|
||||||
Future.delayed(const Duration(seconds: 2)).then((value) {
|
Future.delayed(const Duration(seconds: 2)).then((value) {
|
||||||
if (completer.isCompleted) return;
|
if (completer.isCompleted) return;
|
||||||
completer.completeError(
|
completer.completeError(
|
||||||
GenericException(type: ExceptionType.ConnectionError));
|
GenericException(type: ExceptionType.connectionError));
|
||||||
});
|
});
|
||||||
|
|
||||||
return completer.future;
|
return completer.future;
|
||||||
|
|
@ -48,13 +47,13 @@ extension Converter on Socket {
|
||||||
onConnectError((data) {
|
onConnectError((data) {
|
||||||
if (completer.isCompleted) return;
|
if (completer.isCompleted) return;
|
||||||
completer
|
completer
|
||||||
.completeError(GenericException(type: ExceptionType.ConnectionError));
|
.completeError(GenericException(type: ExceptionType.connectionError));
|
||||||
});
|
});
|
||||||
|
|
||||||
onConnectTimeout((data) {
|
onConnectTimeout((data) {
|
||||||
if (completer.isCompleted) return;
|
if (completer.isCompleted) return;
|
||||||
completer
|
completer
|
||||||
.completeError(GenericException(type: ExceptionType.ConnectionError));
|
.completeError(GenericException(type: ExceptionType.connectionError));
|
||||||
});
|
});
|
||||||
|
|
||||||
return completer.future;
|
return completer.future;
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class SocketIO {
|
||||||
onTimeout: () {
|
onTimeout: () {
|
||||||
onError?.call();
|
onError?.call();
|
||||||
throw GenericException(
|
throw GenericException(
|
||||||
type: ExceptionType.ConnectionError,
|
type: ExceptionType.connectionError,
|
||||||
errorMessage: "You Have no Internet Connection",
|
errorMessage: "You Have no Internet Connection",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
@ -121,7 +121,7 @@ class SocketIO {
|
||||||
throw badRequestException[
|
throw badRequestException[
|
||||||
ack["error"]["name"] ?? "INTERNAL_SERVER_ERROR"] ??
|
ack["error"]["name"] ?? "INTERNAL_SERVER_ERROR"] ??
|
||||||
GenericException(
|
GenericException(
|
||||||
type: ExceptionType.InternalServerException,
|
type: ExceptionType.internalServerException,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -129,7 +129,7 @@ class SocketIO {
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
throw GenericException(
|
throw GenericException(
|
||||||
type: ExceptionType.InternalServerException,
|
type: ExceptionType.internalServerException,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return ack["data"];
|
return ack["data"];
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import 'package:taafee_mobile/common/const/const.dart';
|
import 'package:taafee_mobile/common/const/const.dart';
|
||||||
|
|
@ -20,7 +21,10 @@ class AboutUsScreen extends StatelessWidget {
|
||||||
HeaderScreen("about_us".tr)
|
HeaderScreen("about_us".tr)
|
||||||
.paddingOnly(top: 20, bottom: 80)
|
.paddingOnly(top: 20, bottom: 80)
|
||||||
.paddingSymmetric(horizontal: 30),
|
.paddingSymmetric(horizontal: 30),
|
||||||
Image.asset("assets/images/logo.png"),
|
SizedBox(
|
||||||
|
width: 168,
|
||||||
|
height: 168,
|
||||||
|
child: SvgPicture.asset("assets/icons/tafee icon.svg")),
|
||||||
MediumTextWidget(
|
MediumTextWidget(
|
||||||
Params.aboutUs,
|
Params.aboutUs,
|
||||||
fontSize: Responsive.isTablet() ? 24 : null,
|
fontSize: Responsive.isTablet() ? 24 : null,
|
||||||
|
|
|
||||||
|
|
@ -579,7 +579,7 @@ showMessageDialog(String message) {
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Add Successfuly.json',
|
'assets/animations/Add Success.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
),
|
),
|
||||||
MediumTextWidget(
|
MediumTextWidget(
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,7 @@ class CardController extends GetxController {
|
||||||
List<String> cardNetworkImagesUrls = <String>[].obs;
|
List<String> cardNetworkImagesUrls = <String>[].obs;
|
||||||
void updateCardNetworkImageUrls(List<CardImages> cardImages) {
|
void updateCardNetworkImageUrls(List<CardImages> cardImages) {
|
||||||
cardNetworkImagesUrls.clear();
|
cardNetworkImagesUrls.clear();
|
||||||
|
// ignore: avoid_function_literals_in_foreach_calls
|
||||||
cardImages.forEach((element) {
|
cardImages.forEach((element) {
|
||||||
cardNetworkImagesUrls.add(Domain.domain + element.url.substring(6));
|
cardNetworkImagesUrls.add(Domain.domain + element.url.substring(6));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import 'package:smooth_page_indicator/smooth_page_indicator.dart';
|
||||||
|
|
||||||
import '../../../../core/local_storage/local_storage.dart';
|
import '../../../../core/local_storage/local_storage.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class ImagesGalleryView extends StatelessWidget {
|
class ImagesGalleryView extends StatelessWidget {
|
||||||
ImagesGalleryView({super.key});
|
ImagesGalleryView({super.key});
|
||||||
final Key galleryViewKey = const Key('gallery');
|
final Key galleryViewKey = const Key('gallery');
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import '../../../../common/widgets/button.dart';
|
||||||
import '../../../../common/widgets/text.dart';
|
import '../../../../common/widgets/text.dart';
|
||||||
import '../../../../core/routing/routing_manager.dart';
|
import '../../../../core/routing/routing_manager.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class FavoriteWidget extends StatelessWidget {
|
class FavoriteWidget extends StatelessWidget {
|
||||||
final CardController cardController = Get.find<CardController>();
|
final CardController cardController = Get.find<CardController>();
|
||||||
final FavoriteController favoriteController = Get.find<FavoriteController>();
|
final FavoriteController favoriteController = Get.find<FavoriteController>();
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class CategoryDetailsScreen extends StatelessWidget {
|
||||||
: Column(
|
: Column(
|
||||||
children: [
|
children: [
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Folder Lottie.json',
|
'assets/animations/folder.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
).paddingAll(40),
|
).paddingAll(40),
|
||||||
RegularTextWidget(
|
RegularTextWidget(
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import 'package:taafee_mobile/features/chat/data_layer/model/chat_user.dart';
|
||||||
import 'package:taafee_mobile/features/chat/data_layer/model/room.dart';
|
import 'package:taafee_mobile/features/chat/data_layer/model/room.dart';
|
||||||
import 'package:taafee_mobile/features/chat/data_layer/service/chat_resource.dart'
|
import 'package:taafee_mobile/features/chat/data_layer/service/chat_resource.dart'
|
||||||
as resource;
|
as resource;
|
||||||
import 'package:path_provider/path_provider.dart';
|
// import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:rx_future/rx_future.dart';
|
import 'package:rx_future/rx_future.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import '../../../core/errors/custom_exception.dart';
|
import '../../../core/errors/custom_exception.dart';
|
||||||
|
|
@ -88,7 +88,7 @@ class ChatController extends GetxController {
|
||||||
});
|
});
|
||||||
connectionState.refresh();
|
connectionState.refresh();
|
||||||
throw GenericException(
|
throw GenericException(
|
||||||
type: ExceptionType.ConnectionError,
|
type: ExceptionType.connectionError,
|
||||||
errorMessage: "You Have no Internet Connection",
|
errorMessage: "You Have no Internet Connection",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
@ -685,8 +685,7 @@ class ChatController extends GetxController {
|
||||||
|
|
||||||
Future record() async {
|
Future record() async {
|
||||||
if (!isRecordReady) return;
|
if (!isRecordReady) return;
|
||||||
Directory tempDir = await getTemporaryDirectory();
|
|
||||||
DateTime date = DateTime.now();
|
|
||||||
await voiceRecorder.startRecorder(
|
await voiceRecorder.startRecorder(
|
||||||
toFile: '${Utils.randomString(5)}${Random().nextInt(100000)}');
|
toFile: '${Utils.randomString(5)}${Random().nextInt(100000)}');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,5 @@ class ChatUser {
|
||||||
avatar: jsonMap['avatar'],
|
avatar: jsonMap['avatar'],
|
||||||
);
|
);
|
||||||
//this didn't work because default parameter value must be cosnt and factory cannot be const
|
//this didn't work because default parameter value must be cosnt and factory cannot be const
|
||||||
factory ChatUser.zero() => ChatUser(id: 0, name: '');
|
factory ChatUser.zero() => const ChatUser(id: 0, name: '');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class MessageModel {
|
||||||
factory MessageModel.zero() => MessageModel(
|
factory MessageModel.zero() => MessageModel(
|
||||||
content: "",
|
content: "",
|
||||||
createdAt: DateTime.now(),
|
createdAt: DateTime.now(),
|
||||||
user: ChatUser(id: 0, name: 'name'),
|
user: const ChatUser(id: 0, name: 'name'),
|
||||||
userId: 0,
|
userId: 0,
|
||||||
roomId: 0,
|
roomId: 0,
|
||||||
//sender: const ChatUser(id: '0', name: '')
|
//sender: const ChatUser(id: '0', name: '')
|
||||||
|
|
@ -77,7 +77,7 @@ class MessageModel {
|
||||||
? ChatUser.fromJson(jsonMap['User'])
|
? ChatUser.fromJson(jsonMap['User'])
|
||||||
: ((jsonMap['user'] != null)
|
: ((jsonMap['user'] != null)
|
||||||
? ChatUser.fromJson(jsonMap['user'])
|
? ChatUser.fromJson(jsonMap['user'])
|
||||||
: ChatUser(id: 0, name: 'name')),
|
: const ChatUser(id: 0, name: 'name')),
|
||||||
createdAt: DateTime.parse(jsonMap['createdAt']).toLocal(),
|
createdAt: DateTime.parse(jsonMap['createdAt']).toLocal(),
|
||||||
updatedAt: (jsonMap['updatedAt'] != null)
|
updatedAt: (jsonMap['updatedAt'] != null)
|
||||||
? DateTime.parse(jsonMap['updatedAt']).toLocal()
|
? DateTime.parse(jsonMap['updatedAt']).toLocal()
|
||||||
|
|
@ -93,6 +93,7 @@ class MessageModel {
|
||||||
static List<Map<String, dynamic>> toJsonList(
|
static List<Map<String, dynamic>> toJsonList(
|
||||||
List<MessageModel> messagesList) {
|
List<MessageModel> messagesList) {
|
||||||
List<Map<String, dynamic>> jsonList = [];
|
List<Map<String, dynamic>> jsonList = [];
|
||||||
|
// ignore: avoid_function_literals_in_foreach_calls
|
||||||
messagesList.forEach((element) {
|
messagesList.forEach((element) {
|
||||||
jsonList.add(element.toJson());
|
jsonList.add(element.toJson());
|
||||||
});
|
});
|
||||||
|
|
@ -101,6 +102,7 @@ class MessageModel {
|
||||||
|
|
||||||
static List<MessageModel> fromJsonList(List jsonList) {
|
static List<MessageModel> fromJsonList(List jsonList) {
|
||||||
List<MessageModel> messages = [];
|
List<MessageModel> messages = [];
|
||||||
|
// ignore: avoid_function_literals_in_foreach_calls
|
||||||
jsonList.forEach((element) {
|
jsonList.forEach((element) {
|
||||||
messages.add(MessageModel.fromJson(element));
|
messages.add(MessageModel.fromJson(element));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ class Room {
|
||||||
);
|
);
|
||||||
static List<Room> fromJsonList(List jsonList) {
|
static List<Room> fromJsonList(List jsonList) {
|
||||||
List<Room> rooms = [];
|
List<Room> rooms = [];
|
||||||
|
// ignore: avoid_function_literals_in_foreach_calls
|
||||||
jsonList.forEach((element) {
|
jsonList.forEach((element) {
|
||||||
if (element["type"] == "private") {
|
if (element["type"] == "private") {
|
||||||
rooms.add(Room.fromJson(element));
|
rooms.add(Room.fromJson(element));
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import 'package:taafee_mobile/core/local_storage/local_storage.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
class ChatFilesSource {
|
class ChatFilesSource {
|
||||||
Dio _dio = Dio(BaseOptions(
|
final Dio _dio = Dio(BaseOptions(
|
||||||
baseUrl: 'https://pages-chat-dev.octa-apps.com/',
|
baseUrl: 'https://pages-chat-dev.octa-apps.com/',
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": LocalStorage().getChatToken(),
|
"Authorization": LocalStorage().getChatToken(),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:taafee_mobile/core/network/socket/event.dart';
|
import 'package:taafee_mobile/core/network/socket/event.dart';
|
||||||
import 'package:taafee_mobile/core/network/socket/events.dart';
|
import 'package:taafee_mobile/core/network/socket/events.dart';
|
||||||
|
|
@ -27,10 +29,10 @@ class ChatResource {
|
||||||
"peer": {"id": id}
|
"peer": {"id": id}
|
||||||
}),
|
}),
|
||||||
reciveDataOnError: true);
|
reciveDataOnError: true);
|
||||||
print('my ack is $ack');
|
log('my ack is $ack');
|
||||||
if (ack['error'] != null &&
|
if (ack['error'] != null &&
|
||||||
ack['error']['msg'] == 'The resource already exists') {
|
ack['error']['msg'] == 'The resource already exists') {
|
||||||
print(ack['error']['justification'].toString().substring(51, 53));
|
log(ack['error']['justification'].toString().substring(51, 53));
|
||||||
int roomId = ack['error']['meta']['roomId'];
|
int roomId = ack['error']['meta']['roomId'];
|
||||||
return Room(
|
return Room(
|
||||||
id: roomId,
|
id: roomId,
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import 'package:taafee_mobile/features/home/presentation_layer/widgets/search_ba
|
||||||
import '../../../../common/widgets/loader.dart';
|
import '../../../../common/widgets/loader.dart';
|
||||||
import '../../../../core/utils/utils.dart';
|
import '../../../../core/utils/utils.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class ChatScreen extends StatelessWidget {
|
class ChatScreen extends StatelessWidget {
|
||||||
ChatScreen({super.key});
|
ChatScreen({super.key});
|
||||||
final ChatController chatController = Get.find<ChatController>();
|
final ChatController chatController = Get.find<ChatController>();
|
||||||
|
|
@ -32,7 +33,6 @@ class ChatScreen extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
int today = DateTime.now().day;
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.backGroundColor,
|
backgroundColor: AppColors.backGroundColor,
|
||||||
|
|
@ -44,7 +44,7 @@ class ChatScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
physics: BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -86,7 +86,7 @@ class ChatScreen extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Wifi Lottie.json',
|
'assets/animations/Wifi.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
width: 120,
|
width: 120,
|
||||||
).paddingAll(5).paddingOnly(top: 80),
|
).paddingAll(5).paddingOnly(top: 80),
|
||||||
|
|
@ -113,7 +113,7 @@ class ChatScreen extends StatelessWidget {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Folder Lottie.json',
|
'assets/animations/folder.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
),
|
),
|
||||||
if (searchFieldController.text == '')
|
if (searchFieldController.text == '')
|
||||||
|
|
@ -184,7 +184,7 @@ class ChatScreen extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Wifi Lottie.json',
|
'assets/animations/Wifi.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
width: 120,
|
width: 120,
|
||||||
).paddingAll(5).paddingOnly(top: 80),
|
).paddingAll(5).paddingOnly(top: 80),
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import '../../../../common/widgets/toast.dart';
|
||||||
import '../../data_layer/model/room.dart';
|
import '../../data_layer/model/room.dart';
|
||||||
import '../widgets/message_widget.dart';
|
import '../widgets/message_widget.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class ChatDetails extends StatelessWidget {
|
class ChatDetails extends StatelessWidget {
|
||||||
ChatDetails({super.key});
|
ChatDetails({super.key});
|
||||||
|
|
||||||
|
|
@ -58,7 +59,7 @@ class ChatDetails extends StatelessWidget {
|
||||||
|
|
||||||
void checkTablet() {
|
void checkTablet() {
|
||||||
if (Responsive.isTablet()) {
|
if (Responsive.isTablet()) {
|
||||||
Future.delayed(Duration(seconds: 2), () {
|
Future.delayed(const Duration(seconds: 2), () {
|
||||||
chatController.getCurrentRoomMessages();
|
chatController.getCurrentRoomMessages();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +91,7 @@ class ChatDetails extends StatelessWidget {
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
physics: NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -357,14 +358,14 @@ class ChatDetails extends StatelessWidget {
|
||||||
visible: (chatController.currentRoom.value!.state !=
|
visible: (chatController.currentRoom.value!.state !=
|
||||||
RoomState.active),
|
RoomState.active),
|
||||||
child: Material(
|
child: Material(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(16),
|
topLeft: Radius.circular(16),
|
||||||
topRight: Radius.circular(16),
|
topRight: Radius.circular(16),
|
||||||
),
|
),
|
||||||
elevation: 15,
|
elevation: 15,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(16),
|
topLeft: Radius.circular(16),
|
||||||
topRight: Radius.circular(16),
|
topRight: Radius.circular(16),
|
||||||
|
|
@ -409,8 +410,7 @@ class ChatDetails extends StatelessWidget {
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 160,
|
width: 160,
|
||||||
height: 160,
|
height: 160,
|
||||||
child: Lottie.asset(
|
child: Lottie.asset('assets/animations/Wifi.json')))
|
||||||
'assets/animations/Wifi Lottie.json')))
|
|
||||||
.align(alignment: Alignment.center);
|
.align(alignment: Alignment.center);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import 'package:taafee_mobile/features/home/business_logic_layer/home_controller
|
||||||
import '../../business logic layer/chat_controller.dart';
|
import '../../business logic layer/chat_controller.dart';
|
||||||
import '../../data_layer/model/room.dart';
|
import '../../data_layer/model/room.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class AppBarChatWidget extends StatelessWidget implements PreferredSizeWidget {
|
class AppBarChatWidget extends StatelessWidget implements PreferredSizeWidget {
|
||||||
@override
|
@override
|
||||||
Size get preferredSize => const Size.fromHeight(100);
|
Size get preferredSize => const Size.fromHeight(100);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import '../../../../common/const/const.dart';
|
||||||
import '../../../../core/utils/utils.dart';
|
import '../../../../core/utils/utils.dart';
|
||||||
import '../../data_layer/model/message.dart';
|
import '../../data_layer/model/message.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class ChatFooterWidget extends StatelessWidget {
|
class ChatFooterWidget extends StatelessWidget {
|
||||||
final TextEditingController textController = TextEditingController();
|
final TextEditingController textController = TextEditingController();
|
||||||
final ChatController chatController = Get.find<ChatController>();
|
final ChatController chatController = Get.find<ChatController>();
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ class MessageWidget extends StatelessWidget {
|
||||||
chatController.uploadFileState.loading))
|
chatController.uploadFileState.loading))
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: SizedBox(
|
child: const SizedBox(
|
||||||
width: 12,
|
width: 12,
|
||||||
height: 12,
|
height: 12,
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import 'package:taafee_mobile/features/home/business_logic_layer/home_controller
|
||||||
import '../../../../common/const/const.dart';
|
import '../../../../common/const/const.dart';
|
||||||
import '../../../../common/widgets/text.dart';
|
import '../../../../common/widgets/text.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class RepliedMessage extends StatelessWidget {
|
class RepliedMessage extends StatelessWidget {
|
||||||
RepliedMessage({
|
RepliedMessage({
|
||||||
super.key,
|
super.key,
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ class FavoriteScreen extends StatelessWidget {
|
||||||
width: 128,
|
width: 128,
|
||||||
height: 128,
|
height: 128,
|
||||||
child: Lottie.asset(
|
child: Lottie.asset(
|
||||||
'assets/animations/No Favorites.json',
|
'assets/animations/NO Favorite.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class FavoriteCardWidget extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset("assets/icons/love-svgrepo-com 2.svg"),
|
SvgPicture.asset("assets/icons/love-svgrepo-com 2.svg"),
|
||||||
MediumTextWidget(
|
MediumTextWidget(
|
||||||
" ${favoriteModel.cardModel.user.firstName + ' ' + favoriteModel.cardModel.user.lastName}"),
|
" ${'${favoriteModel.cardModel.user.firstName} ${favoriteModel.cardModel.user.lastName}'}"),
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: 10),
|
).paddingSymmetric(horizontal: 10),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ import 'package:taafee_mobile/common/widgets/toast.dart';
|
||||||
import 'package:taafee_mobile/core/routing/routing_manager.dart';
|
import 'package:taafee_mobile/core/routing/routing_manager.dart';
|
||||||
import 'package:taafee_mobile/features/auth/business_logic_layer/auth_controller.dart';
|
import 'package:taafee_mobile/features/auth/business_logic_layer/auth_controller.dart';
|
||||||
import 'package:taafee_mobile/features/card/business_logic_layer/card_controller.dart';
|
import 'package:taafee_mobile/features/card/business_logic_layer/card_controller.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
|
// import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/source/card_service.dart';
|
// import 'package:taafee_mobile/features/card/data_layer/source/card_service.dart';
|
||||||
import 'package:taafee_mobile/features/card/presentation_layer/widgets/card.dart';
|
import 'package:taafee_mobile/features/card/presentation_layer/widgets/card.dart';
|
||||||
import 'package:taafee_mobile/features/card/presentation_layer/widgets/random_card_widget.dart';
|
import 'package:taafee_mobile/features/card/presentation_layer/widgets/random_card_widget.dart';
|
||||||
import 'package:taafee_mobile/features/category/business_logic_layer/category_controller.dart';
|
import 'package:taafee_mobile/features/category/business_logic_layer/category_controller.dart';
|
||||||
|
|
@ -23,6 +23,7 @@ import 'package:taafee_mobile/features/chat/business%20logic%20layer/chat_contro
|
||||||
import 'package:taafee_mobile/features/home/business_logic_layer/home_controller.dart';
|
import 'package:taafee_mobile/features/home/business_logic_layer/home_controller.dart';
|
||||||
import 'package:taafee_mobile/features/home/presentation_layer/widgets/appbar.dart';
|
import 'package:taafee_mobile/features/home/presentation_layer/widgets/appbar.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class HomeScreen extends StatelessWidget {
|
class HomeScreen extends StatelessWidget {
|
||||||
final HomeController homeController = Get.find<HomeController>();
|
final HomeController homeController = Get.find<HomeController>();
|
||||||
final CategoryController categoryController = Get.find<CategoryController>();
|
final CategoryController categoryController = Get.find<CategoryController>();
|
||||||
|
|
@ -159,7 +160,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Wifi Lottie.json',
|
'assets/animations/Wifi.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
width: 120,
|
width: 120,
|
||||||
).paddingAll(5),
|
).paddingAll(5),
|
||||||
|
|
@ -241,7 +242,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
height: Get.height * 0.08,
|
height: Get.height * 0.08,
|
||||||
),
|
),
|
||||||
Lottie.asset(
|
Lottie.asset(
|
||||||
'assets/animations/Wifi Lottie.json',
|
'assets/animations/Wifi.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
width: 120,
|
width: 120,
|
||||||
).paddingAll(5),
|
).paddingAll(5),
|
||||||
|
|
@ -318,7 +319,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
width: 120,
|
width: 120,
|
||||||
height: 120,
|
height: 120,
|
||||||
child: Lottie.asset(
|
child: Lottie.asset(
|
||||||
'assets/animations/Folder Lottie.json',
|
'assets/animations/folder.json',
|
||||||
repeat: false,
|
repeat: false,
|
||||||
)),
|
)),
|
||||||
RegularTextWidget(
|
RegularTextWidget(
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,10 @@ import 'package:taafee_mobile/features/chat/presentation_layer/screens/chat.dart
|
||||||
import 'package:taafee_mobile/features/favorite/business_logic_layer/favorite_controller.dart';
|
import 'package:taafee_mobile/features/favorite/business_logic_layer/favorite_controller.dart';
|
||||||
import 'package:taafee_mobile/features/favorite/presentation_layer/screens/favorite.dart';
|
import 'package:taafee_mobile/features/favorite/presentation_layer/screens/favorite.dart';
|
||||||
import 'package:taafee_mobile/features/home/business_logic_layer/home_controller.dart';
|
import 'package:taafee_mobile/features/home/business_logic_layer/home_controller.dart';
|
||||||
|
|
||||||
import '../../../../common/const/const.dart';
|
import '../../../../common/const/const.dart';
|
||||||
import '../../../auth/data_layer/model/user.dart';
|
import '../../../auth/data_layer/model/user.dart';
|
||||||
import '../../../card/data_layer/model/card_model.dart';
|
// import '../../../card/data_layer/model/card_model.dart';
|
||||||
import '../../../card/data_layer/source/card_service.dart';
|
// import '../../../card/data_layer/source/card_service.dart';
|
||||||
import '../../../chat/business logic layer/chat_controller.dart';
|
import '../../../chat/business logic layer/chat_controller.dart';
|
||||||
import '../../../chat/data_layer/model/room.dart';
|
import '../../../chat/data_layer/model/room.dart';
|
||||||
import 'home.dart';
|
import 'home.dart';
|
||||||
|
|
@ -65,7 +64,7 @@ class SuperHome extends StatelessWidget {
|
||||||
}, onSessionTerminated: (value) {
|
}, onSessionTerminated: (value) {
|
||||||
Toast.showToast('this_session_is_terminated'.tr);
|
Toast.showToast('this_session_is_terminated'.tr);
|
||||||
RoutingManager.offAll(RouteName.login);
|
RoutingManager.offAll(RouteName.login);
|
||||||
print('session terminated');
|
// print('session terminated');
|
||||||
authController.isGuest.update((val) {
|
authController.isGuest.update((val) {
|
||||||
val = false;
|
val = false;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,11 @@ import 'package:taafee_mobile/core/routing/routing_manager.dart';
|
||||||
import 'package:taafee_mobile/features/chat/presentation_layer/widgets/circle_avatar.dart';
|
import 'package:taafee_mobile/features/chat/presentation_layer/widgets/circle_avatar.dart';
|
||||||
import 'package:taafee_mobile/features/home/business_logic_layer/home_controller.dart';
|
import 'package:taafee_mobile/features/home/business_logic_layer/home_controller.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
class AppBarWidget extends StatelessWidget {
|
class AppBarWidget extends StatelessWidget {
|
||||||
final HomeController homeController = Get.find<HomeController>();
|
final HomeController homeController = Get.find<HomeController>();
|
||||||
TextEditingController? textEditingController;
|
TextEditingController? textEditingController;
|
||||||
@override
|
@override
|
||||||
// TODO: implement preferredSize
|
|
||||||
// Size get preferredSize => const Size.fromHeight(250);
|
|
||||||
AppBarWidget({super.key, this.textEditingController});
|
AppBarWidget({super.key, this.textEditingController});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ import 'package:taafee_mobile/core/init/dependency_injection.dart';
|
||||||
import 'package:taafee_mobile/core/init/language_init.dart';
|
import 'package:taafee_mobile/core/init/language_init.dart';
|
||||||
import 'package:taafee_mobile/core/localization/localization.dart';
|
import 'package:taafee_mobile/core/localization/localization.dart';
|
||||||
import 'package:taafee_mobile/core/routing/routing_manager.dart';
|
import 'package:taafee_mobile/core/routing/routing_manager.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/source/card_service.dart';
|
// import 'package:taafee_mobile/features/card/data_layer/source/card_service.dart';
|
||||||
import 'common/widgets/notification_message.dart';
|
// import 'common/widgets/notification_message.dart';
|
||||||
import 'core/local_storage/cache_service.dart';
|
import 'core/local_storage/cache_service.dart';
|
||||||
import 'core/local_storage/local_storage.dart';
|
// import 'core/local_storage/local_storage.dart';
|
||||||
import 'core/utils/utils.dart';
|
import 'core/utils/utils.dart';
|
||||||
import 'features/card/data_layer/model/card_model.dart';
|
// import 'features/card/data_layer/model/card_model.dart';
|
||||||
|
|
||||||
String? fcmToken;
|
String? fcmToken;
|
||||||
void main() async {
|
void main() async {
|
||||||
|
|
@ -24,7 +24,7 @@ void main() async {
|
||||||
await GetStorage.init();
|
await GetStorage.init();
|
||||||
// await Firebase.initializeApp();
|
// await Firebase.initializeApp();
|
||||||
// if (LocalStorage().getFCMToken() == null) {
|
// if (LocalStorage().getFCMToken() == null) {
|
||||||
// fcmToken = await FirebaseMessaging.instance.getToken();
|
// fcmToken = await FirebaseMessaging.instance.getToken();
|
||||||
// if (fcmToken != null) {
|
// if (fcmToken != null) {
|
||||||
// LocalStorage().saveFCMToken(fcmToken!);
|
// LocalStorage().saveFCMToken(fcmToken!);
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user