From 8018120c6a8fbf81c2fd58dd3aec0395fc0e123e Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 27 Nov 2022 10:37:32 +0300 Subject: [PATCH] chat structure issues. --- lib/api/chat/chat_provider_model.dart | 2 ++ lib/classes/consts.dart | 4 ++-- lib/ui/chat/call/chat_incoming_call_screen.dart | 2 ++ lib/ui/chat/chat_bubble.dart | 3 ++- lib/ui/chat/chat_detailed_screen.dart | 5 +++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/api/chat/chat_provider_model.dart b/lib/api/chat/chat_provider_model.dart index 7a27c1f..16eb97f 100644 --- a/lib/api/chat/chat_provider_model.dart +++ b/lib/api/chat/chat_provider_model.dart @@ -40,6 +40,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { List favUsersList = []; int paginationVal = 0; + // todo: @aamir need to make a separate api client for chat, need to improve code structure. + Future getUserAutoLoginToken(BuildContext cxt) async { Response response = await ApiClient().postJsonForResponse( "${ApiConsts.chatServerBaseApiUrl}user/externaluserlogin", diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index c5788f9..646e498 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -1,7 +1,7 @@ class ApiConsts { //static String baseUrl = "http://10.200.204.20:2801/"; // Local server - //static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server - static String baseUrl = "https://hmgwebservices.com"; // Live server + static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server + // static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/ui/chat/call/chat_incoming_call_screen.dart b/lib/ui/chat/call/chat_incoming_call_screen.dart index a0b8247..1b6a5aa 100644 --- a/lib/ui/chat/call/chat_incoming_call_screen.dart +++ b/lib/ui/chat/call/chat_incoming_call_screen.dart @@ -91,6 +91,8 @@ class _IncomingCallState extends State with SingleTickerProviderSt mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceAround, children: const [ + + // todo @aamir, need to use extension mehtods Text( "Aamir Saleem Ahmad", style: TextStyle( diff --git a/lib/ui/chat/chat_bubble.dart b/lib/ui/chat/chat_bubble.dart index 1696a49..ce2e7db 100644 --- a/lib/ui/chat/chat_bubble.dart +++ b/lib/ui/chat/chat_bubble.dart @@ -3,7 +3,8 @@ import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -import 'package:sizer/sizer.dart'; + +// todo: @aamir use extension methods, and use correct widgets. class ChatBubble extends StatelessWidget { const ChatBubble( diff --git a/lib/ui/chat/chat_detailed_screen.dart b/lib/ui/chat/chat_detailed_screen.dart index 4a8e70c..d8a9cbd 100644 --- a/lib/ui/chat/chat_detailed_screen.dart +++ b/lib/ui/chat/chat_detailed_screen.dart @@ -30,6 +30,8 @@ class ChatDetailScreen extends StatefulWidget { State createState() => _ChatDetailScreenState(); } +// todo: @aamir use extension methods, and use correct widgets. + class _ChatDetailScreenState extends State { dynamic userDetails; late ChatProviderModel data; @@ -194,6 +196,7 @@ class _ChatDetailScreenState extends State { ], ), if (m.isFileSelected && m.sFileType == ".png" || m.sFileType == ".jpeg" || m.sFileType == ".jpg") + // todo @aamir use correct code Card( margin: EdgeInsets.zero, elevation: 0, @@ -383,6 +386,8 @@ class _ChatDetailScreenState extends State { }; CallDataModel incomingCallData = CallDataModel.fromJson(json); + + // todo @aamir, we are using namedPagedRoute, need to replace await Navigator.push( context, MaterialPageRoute(