Chat Favorite Screen & Fixes

merge-requests/55/head
Aamir Muhammad 3 years ago
parent fb54403584
commit 670a5fbc03

@ -499,7 +499,7 @@
"resend": "إعادة إرسال",
"codeExpire": "انتهت صلاحية رمز التحقق",
"typeheretoreply": "اكتب هنا للرد",
"favorite" : "مفضل",
"favorite" : "أُفضله",
"searchfromchat": "البحث من الدردشة"
}

@ -499,7 +499,7 @@
"codeExpire": "The verification code has been expired",
"allQuestionsCorrect": "You have answered all questions correct",
"typeheretoreply": "Type here to reply",
"favorite" : "Favorite",
"favorite" : "My Favorite",
"searchfromchat": "Search from chat"
}

@ -23,6 +23,7 @@ import 'package:uuid/uuid.dart';
class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
ScrollController scrollController = ScrollController();
TextEditingController message = TextEditingController();
TextEditingController search = TextEditingController();
List<SingleUserChatModel> userChatHistory = [];
List<ChatUser>? pChatHistory, searchedChats;
late HubConnection hubConnection;
@ -582,12 +583,15 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
void clearSelections() {
searchedChats = pChatHistory;
search.clear();
isChatScreenActive = false;
paginationVal = 0;
message.text = '';
isFileSelected = false;
repliedMsg = [];
sFileType = "";
notifyListeners();
}
void scrollListener() {

@ -515,7 +515,7 @@ class CodegenLoader extends AssetLoader{
"resend": "إعادة إرسال",
"codeExpire": "انتهت صلاحية رمز التحقق",
"typeheretoreply": "اكتب هنا للرد",
"favorite": "مفضل",
"favorite": "أُفضله",
"searchfromchat": "البحث من الدردشة"
};
static const Map<String,dynamic> en_US = {
@ -1019,7 +1019,7 @@ static const Map<String,dynamic> en_US = {
"codeExpire": "The verification code has been expired",
"allQuestionsCorrect": "You have answered all questions correct",
"typeheretoreply": "Type here to reply",
"favorite": "Favorite",
"favorite": "My Favorite",
"searchfromchat": "Search from chat"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};

@ -32,28 +32,14 @@ class ChatHomeScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
child: TextField(
controller: m.search,
onChanged: (String val) {
m.filter(val);
},
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: const BorderSide(
color: Color(0xFFE5E5E5),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: const BorderSide(
color: Color(0xFFE5E5E5),
),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: const BorderSide(
color: Color(0xFFE5E5E5),
),
),
border: fieldBorder(radius: 5, color: 0xFFE5E5E5),
focusedBorder: fieldBorder(radius: 5, color: 0xFFE5E5E5),
enabledBorder: fieldBorder(radius: 5, color: 0xFFE5E5E5),
contentPadding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
hintText: LocaleKeys.searchfromchat.tr(),
hintStyle: const TextStyle(color: MyColors.lightTextColor, fontStyle: FontStyle.italic),
@ -73,7 +59,7 @@ class ChatHomeScreen extends StatelessWidget {
height: 55,
child: ListTile(
leading: Stack(
children: [
children: <Widget>[
SvgPicture.asset(
"assets/images/user.svg",
height: 48,
@ -144,12 +130,12 @@ class ChatHomeScreen extends StatelessWidget {
Navigator.pushNamed(
context,
AppRoutes.chatDetailed,
arguments: {"targetUser": m.searchedChats![index], "isNewChat" : false},
arguments: {"targetUser": m.searchedChats![index], "isNewChat": false},
).then((Object? value) {
m.clearSelections();
m.notifyListeners();
});
},
onLongPress: () {},
),
);
},
@ -201,4 +187,13 @@ class ChatHomeScreen extends StatelessWidget {
),
);
}
OutlineInputBorder fieldBorder({required double radius, required int color}) {
return OutlineInputBorder(
borderRadius: BorderRadius.circular(radius),
borderSide: BorderSide(
color: Color(color),
),
);
}
}

Loading…
Cancel
Save