chat pages completed and also resolved some issues
BIN
assets/images/png/Ellipse 53.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
assets/images/png/Photo.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/images/png/Tailgrey.png
Normal file
|
After Width: | Height: | Size: 639 B |
BIN
assets/images/png/arrow-left (2).png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
assets/images/png/blockchat.png
Normal file
|
After Width: | Height: | Size: 371 B |
BIN
assets/images/png/camera1.png
Normal file
|
After Width: | Height: | Size: 494 B |
BIN
assets/images/png/chat.png
Normal file
|
After Width: | Height: | Size: 123 B |
BIN
assets/images/png/chat2.png
Normal file
|
After Width: | Height: | Size: 123 B |
BIN
assets/images/png/chat3.png
Normal file
|
After Width: | Height: | Size: 123 B |
BIN
assets/images/png/chat4.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
assets/images/png/chat5.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
assets/images/png/chat6.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
assets/images/png/chatgroup.png
Normal file
|
After Width: | Height: | Size: 626 B |
BIN
assets/images/png/deletetred.png
Normal file
|
After Width: | Height: | Size: 498 B |
BIN
assets/images/png/editicon.png
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
assets/images/png/groupchat.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
assets/images/png/groupchat2.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/images/png/groupchat3.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/images/png/groupchat4.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
assets/images/png/messagedelivered.png
Normal file
|
After Width: | Height: | Size: 197 B |
BIN
assets/images/png/messagereadcheckmark.png
Normal file
|
After Width: | Height: | Size: 207 B |
BIN
assets/images/png/mute.png
Normal file
|
After Width: | Height: | Size: 331 B |
BIN
assets/images/png/noto_soccer-ball.png
Normal file
|
After Width: | Height: | Size: 705 B |
BIN
assets/images/png/pin.png
Normal file
|
After Width: | Height: | Size: 301 B |
BIN
assets/images/png/profile.png
Normal file
|
After Width: | Height: | Size: 487 B |
BIN
assets/images/png/vertical3dots.png
Normal file
|
After Width: | Height: | Size: 172 B |
@@ -1,4 +1,5 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/chatsmainscreen.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Community/Community.dart';
|
||||
|
||||
class MainController extends GetxController {
|
||||
@@ -8,7 +9,7 @@ class MainController extends GetxController {
|
||||
const CommunityScreen(),
|
||||
const CommunityScreen(),
|
||||
const CommunityScreen(),
|
||||
const CommunityScreen(),
|
||||
const ChatsMainScreen(),
|
||||
const CommunityScreen(),
|
||||
].obs;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ class MainScreen extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: mainController.currentTab[mainController.selectedIndex.value],
|
||||
);
|
||||
});
|
||||
|
||||
878
lib/Feed Module/Main_Screens/Chats/View/chatsmainscreen.dart
Normal file
@@ -0,0 +1,878 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonBottomNavigationBar.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class ChatsMainScreen extends StatefulWidget {
|
||||
const ChatsMainScreen({super.key});
|
||||
|
||||
@override
|
||||
State<ChatsMainScreen> createState() => _ChatsMainScreenState();
|
||||
}
|
||||
|
||||
class _ChatsMainScreenState extends State<ChatsMainScreen> {
|
||||
TextEditingController searchcontroller = TextEditingController();
|
||||
GlobalKey<ScaffoldState> _scaffoldKey1 = GlobalKey<ScaffoldState>();
|
||||
|
||||
List chatcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Ryan Dorwart",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': true,
|
||||
'actstatus': true,
|
||||
'pinned': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Alfonso Rosser",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': true,
|
||||
'actstatus': true,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Tatiana Kenter",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': true,
|
||||
'actstatus': true,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': false,
|
||||
'actstatus': false,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Liverpool FC",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': false,
|
||||
'actstatus': false,
|
||||
'pinned': false,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Abram Westervelt",
|
||||
'subtittle': "Lorem Ipsum is simply dummy text . . .",
|
||||
'messageread': false,
|
||||
'actstatus': false,
|
||||
'pinned': false,
|
||||
}
|
||||
];
|
||||
|
||||
List clubcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Wellness warriors collective",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Body blitz brigade",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Wellness warriors collective",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
];
|
||||
|
||||
List teamcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Cardio crusaders circle",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 48.png",
|
||||
'tittle': "Strength squad syndicate",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Flexibility faction force",
|
||||
'subtittle': "Maria Herwitz : Hello Guys",
|
||||
'messageread': true,
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
appBar: AppBar(
|
||||
scrolledUnderElevation: 0.0,
|
||||
backgroundColor: Color(0xff222935),
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
title: Padding(
|
||||
padding: EdgeInsets.only(left: 16.w),
|
||||
child: Text(
|
||||
'Chats',
|
||||
style: TextStyle(
|
||||
fontSize: 23.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 16.w),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.newchatpage);
|
||||
},
|
||||
child: Image.asset('assets/images/png/editicon.png')),
|
||||
)
|
||||
],
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size.fromHeight(90),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: CustomTextFormField(
|
||||
textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search chats",
|
||||
leadingIcon: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeftRed(),
|
||||
const CommonBlurRightRed(),
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
Stack(
|
||||
children: [
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 0,
|
||||
),
|
||||
child: Column(children: [
|
||||
DefaultTabController(
|
||||
length: 3,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: MyTabBar(),
|
||||
),
|
||||
SizedBox(
|
||||
height: 600.h,
|
||||
child: TabBarView(
|
||||
children: [feedTab(), clubsTab(), teamsTab()],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
])),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget feedTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: chatcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.userchatpage);
|
||||
},
|
||||
child: ChatList(
|
||||
name: chatcontents[index]['tittle'],
|
||||
imageurl: chatcontents[index]['image'],
|
||||
message: chatcontents[index]['subtittle'],
|
||||
isMessageRead: chatcontents[index]['messageread'],
|
||||
activestatus: chatcontents[index]['actstatus'],
|
||||
ispinned: chatcontents[index]['pinned'],
|
||||
count:
|
||||
(index == 0 || index == 1 || index == 2 || index == 3)
|
||||
? true
|
||||
: false),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget clubsTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: clubcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.groupchatpage);
|
||||
},
|
||||
child: SecondChatList(
|
||||
name: clubcontents[index]['tittle'],
|
||||
imageurl: clubcontents[index]['image'],
|
||||
message: clubcontents[index]['subtittle'],
|
||||
isMessageRead: clubcontents[index]['messageread'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget teamsTab() {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: teamcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.groupchatpage);
|
||||
},
|
||||
child: SecondChatList(
|
||||
name: teamcontents[index]['tittle'],
|
||||
imageurl: teamcontents[index]['image'],
|
||||
message: teamcontents[index]['subtittle'],
|
||||
isMessageRead: teamcontents[index]['messageread'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyTabBar extends StatelessWidget {
|
||||
// Set the desired height
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TabBar(
|
||||
dividerColor: Color(0xFFFFFFFF).withOpacity(0.07),
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: Color(0xFFFCFCFC),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica'),
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
indicatorColor: const Color(0xFFD90B2E),
|
||||
// labelColor: Colors.white,
|
||||
indicatorWeight: 2.h,
|
||||
dividerHeight: 2.h,
|
||||
unselectedLabelColor: Color(0xFFFCFCFC),
|
||||
overlayColor: MaterialStateProperty.all(const Color(0xFFD90B2E)),
|
||||
tabs: const [
|
||||
Tab(
|
||||
text: 'Friends',
|
||||
),
|
||||
Tab(
|
||||
text: 'Clubs',
|
||||
),
|
||||
Tab(
|
||||
text: 'Teams',
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ChatList extends StatefulWidget {
|
||||
String name;
|
||||
String imageurl;
|
||||
String message;
|
||||
bool isMessageRead;
|
||||
bool activestatus;
|
||||
bool ispinned;
|
||||
bool count;
|
||||
|
||||
ChatList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
required this.isMessageRead,
|
||||
required this.activestatus,
|
||||
required this.ispinned,
|
||||
required this.count,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ChatList> createState() => _ChatListState();
|
||||
}
|
||||
|
||||
class _ChatListState extends State<ChatList> {
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onLongPressStart: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Stack(children: [
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 40,
|
||||
left: 45,
|
||||
child: widget.activestatus == true
|
||||
? Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: ShapeDecoration(
|
||||
color: Color(0xFF32D74B),
|
||||
shape: OvalBorder(),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: ShapeDecoration(
|
||||
color: Color(0xFFFF453A),
|
||||
shape: OvalBorder(),
|
||||
)),
|
||||
)
|
||||
]),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white(widget.name),
|
||||
sizedBoxHeight(3.h),
|
||||
Row(
|
||||
children: [
|
||||
widget.isMessageRead == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
sizedBoxWidth(5.w),
|
||||
Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
text12400white('Yesterday'),
|
||||
sizedBoxHeight(5.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
widget.ispinned == true
|
||||
? Image.asset('assets/images/png/pin.png')
|
||||
: SizedBox(
|
||||
width: 25,
|
||||
),
|
||||
sizedBoxWidth(3.w),
|
||||
widget.count == true
|
||||
? Container(
|
||||
width: 18,
|
||||
height: 18,
|
||||
decoration: ShapeDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
shape: OvalBorder(),
|
||||
),
|
||||
child: Text(
|
||||
'1',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xFFFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox()
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SecondChatList extends StatefulWidget {
|
||||
final String name;
|
||||
final String imageurl;
|
||||
final String message;
|
||||
final bool isMessageRead;
|
||||
|
||||
SecondChatList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
required this.isMessageRead,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SecondChatList> createState() => _SecondChatListState();
|
||||
}
|
||||
|
||||
class _SecondChatListState extends State<SecondChatList> {
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onLongPressStart: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w), // Add some spacing between image and text
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 3.h),
|
||||
Row(
|
||||
children: [
|
||||
widget.isMessageRead
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
SizedBox(width: 5.w),
|
||||
Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end, // Align to the end of the column
|
||||
children: [
|
||||
Text(
|
||||
'Yesterday',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class SecondChatList extends StatefulWidget {
|
||||
// String name;
|
||||
// String imageurl;
|
||||
// String message;
|
||||
// bool isMessageRead;
|
||||
|
||||
|
||||
// SecondChatList({
|
||||
// Key? key,
|
||||
// required this.name,
|
||||
// required this.imageurl,
|
||||
// required this.message,
|
||||
// required this.isMessageRead,
|
||||
// }) : super(key: key);
|
||||
|
||||
// @override
|
||||
// State<SecondChatList> createState() => _SecondChatListState();
|
||||
// }
|
||||
|
||||
// class _SecondChatListState extends State<SecondChatList> {
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Padding(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
// child: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Container(
|
||||
// width: 55,
|
||||
// height: 55,
|
||||
// decoration: BoxDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage(widget.imageurl),
|
||||
// fit: BoxFit.fill,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: EdgeInsets.only(top: 5),
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// text16400white(widget.name),
|
||||
// sizedBoxHeight(3.h),
|
||||
// Row(
|
||||
// children: [
|
||||
// widget.isMessageRead == true
|
||||
// ? Image.asset(
|
||||
// 'assets/images/png/messagereadcheckmark.png')
|
||||
// : Image.asset('assets/images/png/messagedelivered.png'),
|
||||
// sizedBoxWidth(5.w),
|
||||
// Text(
|
||||
// widget.message,
|
||||
// style: TextStyle(
|
||||
// color: Color(0xCCFCFCFC),
|
||||
// fontSize: 12.sp,
|
||||
// fontFamily: 'Helvetica',
|
||||
// fontWeight: FontWeight.w400,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(top: 5),
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// text12400white('Yesterday'),
|
||||
// ],
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
713
lib/Feed Module/Main_Screens/Chats/View/groupchat.dart
Normal file
@@ -0,0 +1,713 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class GroupChatPage extends StatefulWidget {
|
||||
const GroupChatPage({super.key});
|
||||
|
||||
@override
|
||||
State<GroupChatPage> createState() => _GroupChatPageState();
|
||||
}
|
||||
|
||||
class _GroupChatPageState extends State<GroupChatPage> {
|
||||
ScrollController myController = ScrollController();
|
||||
|
||||
List<ChatMessage> messages = [
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true,
|
||||
image: 'assets/images/png/Photo.png'),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum is simply dummy text of the printing and typesetting industry.",
|
||||
messageType: "sender",
|
||||
isread: true,
|
||||
image: 'assets/images/png/groupchat2.png'),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
|
||||
messageType: "receiver",
|
||||
isread: true,
|
||||
image: 'assets/images/png/groupchat3.png'),
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true,
|
||||
image: 'assets/images/png/groupchat4.png'),
|
||||
];
|
||||
|
||||
String? attachimage;
|
||||
|
||||
final messageController = TextEditingController();
|
||||
|
||||
bool isImageAdded = false;
|
||||
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Search", style: TextStyle(color: Colors.white)),
|
||||
Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Profile", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/profile.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Block chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/blockchat.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 10.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Search chat selected');
|
||||
break;
|
||||
case 3:
|
||||
// Pin chat
|
||||
print('Profile chat selected');
|
||||
break;
|
||||
case 4:
|
||||
// Pin chat
|
||||
print('block chat selected');
|
||||
break;
|
||||
case 5:
|
||||
// Pin chat
|
||||
print('delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void _sendMessage() {
|
||||
if (messageController.text.isNotEmpty) {
|
||||
setState(() {
|
||||
messages.add(ChatMessage(
|
||||
messageContent: messageController.text,
|
||||
messageType: "sender",
|
||||
isread: false,
|
||||
image: 'assets/images/png/groupchat2.png'));
|
||||
messageController.clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Timer(const Duration(milliseconds: 50),
|
||||
() => myController.jumpTo(myController.position.maxScrollExtent));
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.focusScope?.unfocus();
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Color(0xFF222935).withOpacity(0.50),
|
||||
flexibleSpace: SafeArea(
|
||||
child: Container(
|
||||
// height: 90.h,
|
||||
padding: EdgeInsets.only(right: 10.w, left: 4.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
sizedBoxWidth(10.w),
|
||||
commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/appbararrowbutton.png')
|
||||
// Icon(
|
||||
// Icons.arrow_back,
|
||||
// color: Colors.white,
|
||||
// size: 20.sp,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
width: 18.w,
|
||||
),
|
||||
Container(
|
||||
width: 40.h,
|
||||
height: 40.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.h),
|
||||
image: DecorationImage(
|
||||
image:
|
||||
AssetImage("assets/images/png/groupchat.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Liverpool FC',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.white),
|
||||
),
|
||||
sizedBoxWidth(4.w),
|
||||
Image.asset(
|
||||
'assets/images/png/noto_soccer-ball.png')
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 2.h,
|
||||
),
|
||||
Text(
|
||||
"Ryan, Jaxson, Dulce, Nolan ",
|
||||
style: TextStyle(
|
||||
color: Color(0xffFCFCFC).withOpacity(0.80),
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTapDown: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 20,
|
||||
child: Image.asset(
|
||||
'assets/images/png/vertical3dots.png')))
|
||||
|
||||
// ignore: prefer_const_constructors
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeftRed(),
|
||||
const CommonBlurRightRed(),
|
||||
const CommonBlurLeft(),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
// 500.h,
|
||||
MediaQuery.of(context).size.height,
|
||||
borderRadius: 2,
|
||||
blur: 10,
|
||||
alignment: Alignment.bottomLeft,
|
||||
border: 2,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
ListView.builder(
|
||||
controller: myController,
|
||||
itemCount: messages.length,
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 70.0),
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return messages[index].messageType == "receiver"
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
right: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
messages[index].image,
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
shape: OvalBorder(),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(2.w),
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(1.00, -0.03),
|
||||
end: Alignment(-1, 0.03),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.05999999865889549),
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomRight:
|
||||
Radius.circular(20),
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
messages[index].messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 16.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
left: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(1.00, 0.05),
|
||||
end: Alignment(-1, -0.05),
|
||||
colors: [
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x38D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomLeft:
|
||||
Radius.circular(20),
|
||||
)),
|
||||
),
|
||||
padding:
|
||||
const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
messages[index]
|
||||
.messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight:
|
||||
FontWeight.w400,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(2.w),
|
||||
Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
messages[index].image,
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
shape: OvalBorder(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
sizedBoxWidth(16.w),
|
||||
Expanded(
|
||||
child: GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 48.h,
|
||||
borderRadius: 30.r,
|
||||
blur: 10,
|
||||
alignment: Alignment.bottomCenter,
|
||||
border: 0.8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.50),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.50),
|
||||
],
|
||||
stops: [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff434A53),
|
||||
Color(0xFF434A53),
|
||||
],
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: messageController,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(10.0),
|
||||
filled: true,
|
||||
fillColor: Color(0XFF434A53),
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color:
|
||||
Color(0XFFFCFCFC).withOpacity(0.80),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica'),
|
||||
hintText: "Type your message",
|
||||
suffixIcon: messageController
|
||||
.text.isNotEmpty ||
|
||||
isImageAdded == true
|
||||
? GestureDetector(
|
||||
// onTap: () => _chatItemsAdd(),
|
||||
onTap: _sendMessage,
|
||||
// () {
|
||||
// setState(() {
|
||||
// // UploadData();
|
||||
// messageController.clear();
|
||||
// });
|
||||
// },
|
||||
// => UploadData(),
|
||||
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 8.w,
|
||||
top: 2.h,
|
||||
bottom: 2.h),
|
||||
child: Container(
|
||||
width: 45.w,
|
||||
height: 30.h,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
30.r)),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.send_outlined,
|
||||
color: Colors.white,
|
||||
)
|
||||
// Text(
|
||||
// 'Send',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 16.sp),
|
||||
// )
|
||||
)),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () {
|
||||
ImageUploadBottomSheet()
|
||||
.showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
attachimage = result;
|
||||
var filenameresult =
|
||||
extractFileName(result);
|
||||
|
||||
messageController.text =
|
||||
filenameresult;
|
||||
setState(() {
|
||||
isImageAdded = true;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.attach_file,
|
||||
color: Colors.white,
|
||||
size: 23.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
onChanged: (text) {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ChatMessage {
|
||||
String messageContent;
|
||||
String messageType;
|
||||
bool isread;
|
||||
String image;
|
||||
ChatMessage({
|
||||
required this.messageContent,
|
||||
required this.messageType,
|
||||
required this.isread,
|
||||
required this.image,
|
||||
});
|
||||
}
|
||||
300
lib/Feed Module/Main_Screens/Chats/View/newchatpage.dart
Normal file
@@ -0,0 +1,300 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class NewChatPage extends StatefulWidget {
|
||||
const NewChatPage({super.key});
|
||||
|
||||
@override
|
||||
State<NewChatPage> createState() => _NewChatPageState();
|
||||
}
|
||||
|
||||
class _NewChatPageState extends State<NewChatPage> {
|
||||
TextEditingController searchcontroller = TextEditingController();
|
||||
|
||||
List chatcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Ryan Dorwart",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "The athletic town",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Active alliance network",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Maria_01",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// backgroundColor: Color(0xFF222935),
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
|
||||
appBar: CommonAppbar(titleTxt: 'New chat'),
|
||||
body: Stack(children: [
|
||||
const CommonBlurLeftRed(),
|
||||
const CommonBlurRightRed(),
|
||||
const CommonBlurLeft(),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
// 500.h,
|
||||
MediaQuery.of(context).size.height,
|
||||
borderRadius: 2,
|
||||
blur: 10,
|
||||
alignment: Alignment.bottomLeft,
|
||||
border: 2,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
child: ListView(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CustomTextFormField(
|
||||
textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search people",
|
||||
leadingIcon: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.newgrouppage);
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/chatgroup.png'),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.71, -0.70),
|
||||
end: Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.30000001192092896),
|
||||
Colors.white.withOpacity(0.30000001192092896)
|
||||
],
|
||||
),
|
||||
shape: OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50, color: Color(0xFF434A53)),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
text18w400white('New group')
|
||||
],
|
||||
),
|
||||
Image.asset('assets/images/png/arrow-left (2).png')
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text18w700_FCFCFC('Contacts'),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: chatcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {},
|
||||
child: SecondChatList(
|
||||
name: chatcontents[index]['tittle'],
|
||||
imageurl: chatcontents[index]['image'],
|
||||
message: chatcontents[index]['subtittle'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
],
|
||||
),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SecondChatList extends StatefulWidget {
|
||||
final String name;
|
||||
final String imageurl;
|
||||
final String message;
|
||||
|
||||
SecondChatList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SecondChatList> createState() => _SecondChatListState();
|
||||
}
|
||||
|
||||
class _SecondChatListState extends State<SecondChatList> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w), // Add some spacing between image and text
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 3.h),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
365
lib/Feed Module/Main_Screens/Chats/View/newgroup.dart
Normal file
@@ -0,0 +1,365 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class NewGroupPage extends StatefulWidget {
|
||||
const NewGroupPage({super.key});
|
||||
|
||||
@override
|
||||
State<NewGroupPage> createState() => _NewGroupPageState();
|
||||
}
|
||||
|
||||
class _NewGroupPageState extends State<NewGroupPage> {
|
||||
TextEditingController groupnamecontroller = TextEditingController();
|
||||
TextEditingController searchcontroller = TextEditingController();
|
||||
|
||||
List<File?> filePath = [];
|
||||
|
||||
List chatcontents = [
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 52.png",
|
||||
'tittle': "Ryan Dorwart",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "The athletic town",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Active alliance network",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Maria_01",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/Ellipse 53.png",
|
||||
'tittle': "Ahmad Rhiel Madsen",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat4.png",
|
||||
'tittle': "Kaylynn Vaccaro",
|
||||
'subtittle': "FitFam federation",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat5.png",
|
||||
'tittle': "Kianna Donin",
|
||||
'subtittle': "Football fever",
|
||||
},
|
||||
{
|
||||
'image': "assets/images/png/chat6.png",
|
||||
'tittle': "Maria Herwitz",
|
||||
'subtittle': "Row row row your boat",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
appBar: CommonAppbar(titleTxt: 'New group'),
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeftRed(),
|
||||
const CommonBlurRightRed(),
|
||||
const CommonBlurLeft(),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
// 500.h,
|
||||
MediaQuery.of(context).size.height,
|
||||
borderRadius: 2,
|
||||
blur: 10,
|
||||
alignment: Alignment.bottomLeft,
|
||||
border: 2,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
child: ListView(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
filePath.add(file);
|
||||
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
// image: DecorationImage(
|
||||
// image: AssetImage('assets/images/png/camera1.png'),
|
||||
// ),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.71, -0.70),
|
||||
end: Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.30000001192092896),
|
||||
Colors.white.withOpacity(0.30000001192092896)
|
||||
],
|
||||
),
|
||||
shape: OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50, color: Color(0xFF434A53)),
|
||||
),
|
||||
),
|
||||
child:
|
||||
// Obx(
|
||||
// () =>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// addgroupImage.profilePicPath.value != ''
|
||||
filePath.isNotEmpty
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(24.r),
|
||||
child: Image.file(
|
||||
filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
'assets/images/png/camera1.png')
|
||||
],
|
||||
),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 298,
|
||||
child: CustomTextFormField(
|
||||
textEditingController: groupnamecontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Group name",
|
||||
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: text18w700_FCFCFC('Select contacts to add to group'),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: CustomTextFormField(
|
||||
textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search people",
|
||||
leadingIcon: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
);
|
||||
},
|
||||
itemCount: chatcontents.length,
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.only(top: 10.0),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {},
|
||||
child: GroupsList(
|
||||
name: chatcontents[index]['tittle'],
|
||||
imageurl: chatcontents[index]['image'],
|
||||
message: chatcontents[index]['subtittle'],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
text: 'Create group',
|
||||
onPressed: () {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
Get.offUntil(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => MainScreen()),
|
||||
(Route<dynamic> route) => false)
|
||||
;
|
||||
}
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
],
|
||||
),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GroupsList extends StatefulWidget {
|
||||
final String name;
|
||||
final String imageurl;
|
||||
final String message;
|
||||
|
||||
GroupsList({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageurl,
|
||||
required this.message,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<GroupsList> createState() => _GroupsListState();
|
||||
}
|
||||
|
||||
class _GroupsListState extends State<GroupsList> {
|
||||
bool isAdded = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(widget.imageurl),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w), // Add some spacing between image and text
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 5.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.name,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 3.h),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.message,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCFCFCFC),
|
||||
fontSize: 12.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Checkbox(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
side: BorderSide(
|
||||
color: Color(0xFF434A53).withOpacity(0.72), width: 1.5.w),
|
||||
activeColor: Color(0xFF434A53).withOpacity(0.72),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(0.0)),
|
||||
),
|
||||
value: isAdded,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isAdded = value ?? false;
|
||||
});
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
676
lib/Feed Module/Main_Screens/Chats/View/userchat.dart
Normal file
@@ -0,0 +1,676 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class UserChatPage extends StatefulWidget {
|
||||
const UserChatPage({super.key});
|
||||
|
||||
@override
|
||||
State<UserChatPage> createState() => _UserChatPageState();
|
||||
}
|
||||
|
||||
class _UserChatPageState extends State<UserChatPage> {
|
||||
ScrollController myController = ScrollController();
|
||||
|
||||
List<ChatMessage> messages = [
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum is simply dummy text of the printing and typesetting industry.",
|
||||
messageType: "sender",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
|
||||
messageType: "receiver",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent: "That sounds great! I’m in. What time works for you?",
|
||||
messageType: "receiver",
|
||||
isread: true),
|
||||
ChatMessage(
|
||||
messageContent:
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
|
||||
messageType: "sender",
|
||||
isread: false),
|
||||
];
|
||||
|
||||
String? attachimage;
|
||||
|
||||
final messageController = TextEditingController();
|
||||
|
||||
bool isImageAdded = false;
|
||||
|
||||
void _showContextMenu(BuildContext context, Offset offset) {
|
||||
showMenu(
|
||||
color: Color(0XFf222935),
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.r)),
|
||||
position:
|
||||
RelativeRect.fromLTRB(offset.dx, offset.dy, offset.dx, offset.dy),
|
||||
items: [
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Mute chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/mute.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
]),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Pin chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/pin.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Search", style: TextStyle(color: Colors.white)),
|
||||
Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Profile", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/profile.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Block chat", style: TextStyle(color: Colors.white)),
|
||||
Image.asset(
|
||||
'assets/images/png/blockchat.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
thickness: 0.6.h,
|
||||
color: Color(0xffFFFFFF).withOpacity(0.72),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 2,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: 10.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Delete chat", style: TextStyle(color: Colors.red)),
|
||||
// Icon(Icons.delete, color: Colors.red),
|
||||
Image.asset(
|
||||
'assets/images/png/deletetred.png',
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
_onMenuItemSelected(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _onMenuItemSelected(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
// Mute chat
|
||||
print('Mute chat selected');
|
||||
break;
|
||||
case 1:
|
||||
// Pin chat
|
||||
print('Pin chat selected');
|
||||
break;
|
||||
case 2:
|
||||
// Delete chat
|
||||
print('Search chat selected');
|
||||
break;
|
||||
case 3:
|
||||
// Pin chat
|
||||
print('Profile chat selected');
|
||||
break;
|
||||
case 4:
|
||||
// Pin chat
|
||||
print('block chat selected');
|
||||
break;
|
||||
case 5:
|
||||
// Pin chat
|
||||
print('delete chat selected');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void _sendMessage() {
|
||||
if (messageController.text.isNotEmpty) {
|
||||
setState(() {
|
||||
messages.add(ChatMessage(
|
||||
messageContent: messageController.text,
|
||||
messageType: "sender",
|
||||
isread: false,
|
||||
));
|
||||
messageController.clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Timer(const Duration(milliseconds: 50),
|
||||
() => myController.jumpTo(myController.position.maxScrollExtent));
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.focusScope?.unfocus();
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: Color(0xFF222935).withOpacity(0.50),
|
||||
flexibleSpace: SafeArea(
|
||||
child: Container(
|
||||
// height: 90.h,
|
||||
padding: EdgeInsets.only(right: 10.w, left: 4.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
sizedBoxWidth(10.w),
|
||||
commonGlassContainer(
|
||||
border: 0.9,
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/appbararrowbutton.png')
|
||||
// Icon(
|
||||
// Icons.arrow_back,
|
||||
// color: Colors.white,
|
||||
// size: 20.sp,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
width: 18.w,
|
||||
),
|
||||
Container(
|
||||
width: 40.h,
|
||||
height: 40.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.h),
|
||||
image: DecorationImage(
|
||||
image:
|
||||
AssetImage("assets/images/png/Ellipse 52.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SizedBox(
|
||||
width: 12.w,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Ryan Dorwart',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.white),
|
||||
),
|
||||
SizedBox(
|
||||
height: 2.h,
|
||||
),
|
||||
Text(
|
||||
"Ryan_01",
|
||||
style: TextStyle(
|
||||
color: Color(0xffFCFCFC).withOpacity(0.80),
|
||||
fontSize: 12.sp,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTapDown: (details) {
|
||||
_showContextMenu(context, details.globalPosition);
|
||||
},
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 20,
|
||||
child: Image.asset(
|
||||
'assets/images/png/vertical3dots.png')))
|
||||
|
||||
// ignore: prefer_const_constructors
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeftRed(),
|
||||
const CommonBlurRightRed(),
|
||||
const CommonBlurLeft(),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
// 500.h,
|
||||
MediaQuery.of(context).size.height,
|
||||
borderRadius: 2,
|
||||
blur: 10,
|
||||
alignment: Alignment.bottomLeft,
|
||||
border: 2,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
ListView.builder(
|
||||
controller: myController,
|
||||
itemCount: messages.length,
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 70.0),
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return messages[index].messageType == "receiver"
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
right: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(1.00, -0.03),
|
||||
end: Alignment(-1, 0.03),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.05999999865889549),
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.only(
|
||||
topLeft:
|
||||
Radius.circular(20),
|
||||
topRight:
|
||||
Radius.circular(20),
|
||||
bottomRight:
|
||||
Radius.circular(20),
|
||||
),
|
||||
),
|
||||
),
|
||||
padding:
|
||||
const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
messages[index].messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 16.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
left: 90.0),
|
||||
child: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(1.00, 0.05),
|
||||
end: Alignment(-1, -0.05),
|
||||
colors: [
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x38D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomLeft:
|
||||
Radius.circular(20),
|
||||
)),
|
||||
),
|
||||
padding:
|
||||
const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
messages[index].messageContent,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(2.h),
|
||||
messages[index].isread == true
|
||||
? Image.asset(
|
||||
'assets/images/png/messagereadcheckmark.png')
|
||||
: Image.asset(
|
||||
'assets/images/png/messagedelivered.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
sizedBoxWidth(16.w),
|
||||
Expanded(
|
||||
child: GlassmorphicContainer(
|
||||
width: double.infinity,
|
||||
height: 48.h,
|
||||
borderRadius: 30.r,
|
||||
blur: 10,
|
||||
alignment: Alignment.bottomCenter,
|
||||
border: 0.8,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.50),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.50),
|
||||
],
|
||||
stops: [
|
||||
0.1,
|
||||
1,
|
||||
]),
|
||||
borderGradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff434A53),
|
||||
Color(0xFF434A53),
|
||||
],
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: messageController,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(10.0),
|
||||
filled: true,
|
||||
fillColor: Color(0XFF434A53),
|
||||
border: InputBorder.none,
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color:
|
||||
Color(0XFFFCFCFC).withOpacity(0.80),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Helvetica'),
|
||||
hintText: "Type your message",
|
||||
suffixIcon: messageController
|
||||
.text.isNotEmpty ||
|
||||
isImageAdded == true
|
||||
? GestureDetector(
|
||||
// onTap: () => _chatItemsAdd(),
|
||||
onTap: _sendMessage,
|
||||
// () {
|
||||
// setState(() {
|
||||
// // UploadData();
|
||||
// messageController.clear();
|
||||
// });
|
||||
// },
|
||||
// => UploadData(),
|
||||
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 8.w,
|
||||
top: 2.h,
|
||||
bottom: 2.h),
|
||||
child: Container(
|
||||
width: 45.w,
|
||||
height: 30.h,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
30.r)),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.send_outlined,
|
||||
color: Colors.white,
|
||||
)
|
||||
// Text(
|
||||
// 'Send',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 16.sp),
|
||||
// )
|
||||
)),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
onPressed: () {
|
||||
ImageUploadBottomSheet()
|
||||
.showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
attachimage = result;
|
||||
var filenameresult =
|
||||
extractFileName(result);
|
||||
|
||||
messageController.text =
|
||||
filenameresult;
|
||||
setState(() {
|
||||
isImageAdded = true;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.attach_file,
|
||||
color: Colors.white,
|
||||
size: 23.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
onChanged: (text) {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ChatMessage {
|
||||
String messageContent;
|
||||
String messageType;
|
||||
bool isread;
|
||||
ChatMessage({
|
||||
required this.messageContent,
|
||||
required this.messageType,
|
||||
required this.isread,
|
||||
});
|
||||
}
|
||||
@@ -326,7 +326,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
height: 17.h,
|
||||
),
|
||||
// const Icon(Icons.lock_outline),
|
||||
validationMessage: "Enter your password",
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
@@ -346,7 +346,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
child: text14400white('Forgot password ?'),
|
||||
)),
|
||||
sizedBoxHeight(40.h),
|
||||
CustomButton(text: "Login", onPressed: () {}),
|
||||
CustomButton(text: "Login", onPressed: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
}),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
@@ -348,6 +348,17 @@ Widget text18w400_FCFCFC(String text) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget text18w400white(String text) {
|
||||
return Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: Colors.white,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text18w500_FCFCFC(String text) {
|
||||
return Text(
|
||||
text,
|
||||
|
||||
@@ -106,7 +106,9 @@ class _SignupendPageState extends State<SignupendPage> {
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
text: 'Start your journey', onPressed: () {})
|
||||
text: 'Start your journey', onPressed: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
})
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
||||
@@ -156,7 +156,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
height: 17.h,
|
||||
),
|
||||
// const Icon(Icons.lock_outline),
|
||||
validationMessage: "Enter your password",
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
|
||||
@@ -38,6 +38,13 @@ class RouteName {
|
||||
static const String communitysetting = '/communitysetting';
|
||||
static const String editcommunity = '/editcommunity';
|
||||
|
||||
static const String newchatpage = '/newchatpage';
|
||||
static const String newgrouppage = '/newgrouppage';
|
||||
|
||||
static const String userchatpage = '/userchatpage';
|
||||
|
||||
static const String groupchatpage = '/groupchatpage';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import 'package:get/get_navigation/src/routes/get_route.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/groupchat.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/newchatpage.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/newgroup.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/userchat.dart';
|
||||
import 'package:regroup/Feed%20Module/sidemenu/Community/Admin/PopupItem/Community%20settings/CommunitySetting.dart';
|
||||
import 'package:regroup/Feed%20Module/sidemenu/Community/Admin/PopupItem/Community%20settings/EditCommunity/EditCommunity.dart';
|
||||
|
||||
@@ -168,6 +172,26 @@ class AppRoutes {
|
||||
page: () => const EditCommunity(),
|
||||
),
|
||||
|
||||
|
||||
GetPage(
|
||||
name: RouteName.newchatpage,
|
||||
page: () => const NewChatPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.newgrouppage,
|
||||
page: () => const NewGroupPage(),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: RouteName.userchatpage,
|
||||
page: () => const UserChatPage(),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: RouteName.groupchatpage,
|
||||
page: () => const GroupChatPage(),
|
||||
),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||