317 lines
11 KiB
Dart
317 lines
11 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
|
import 'package:regroup/Common/CommonTabBar.dart';
|
|
import 'package:regroup/Common/CommonWidget.dart';
|
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
|
import 'package:regroup/Utils/texts.dart';
|
|
|
|
class ReactionView extends StatefulWidget {
|
|
const ReactionView({super.key});
|
|
|
|
@override
|
|
State<ReactionView> createState() => _ReactionViewState();
|
|
}
|
|
|
|
class _ReactionViewState extends State<ReactionView> {
|
|
List allTabData = [
|
|
{
|
|
"imagePath": "assets/images/png/cimg1.png",
|
|
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
|
"title": "Edward Hackket"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/cimg2.png",
|
|
"reactionimg": "assets/images/png/heart 2.png",
|
|
"title": "Dulce Vaccaro"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/cimg3.png",
|
|
"reactionimg": "assets/images/png/party-popper 2.png",
|
|
"title": "Edward Hackket"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/cimg4.png",
|
|
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
|
"title": "Dulce Vaccaro"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/Rectangle 65.png",
|
|
"reactionimg": "assets/images/png/heart 2.png",
|
|
"title": "Edward Hackket"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/Ellipse 43.png",
|
|
"reactionimg": "assets/images/png/party-popper 2.png",
|
|
"title": "Dulce Vaccaro"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/cimg4.png",
|
|
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
|
"title": "Dulce Vaccaro"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/cimg3.png",
|
|
"reactionimg": "assets/images/png/party-popper 2.png",
|
|
"title": "Edward Hackket"
|
|
},
|
|
{
|
|
"imagePath": "assets/images/png/cimg4.png",
|
|
"reactionimg": "assets/images/png/f7_hand-thumbsup.png",
|
|
"title": "Dulce Vaccaro"
|
|
},
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: const Color(0xFF222935),
|
|
extendBody: true,
|
|
appBar: const CommonAppbar(
|
|
titleTxt: "Post",
|
|
),
|
|
resizeToAvoidBottomInset: false,
|
|
body: Stack(children: [
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
|
fit: BoxFit.fill)),
|
|
), Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
sizedBoxHeight(10.h),
|
|
Expanded(
|
|
child: DefaultTabController(
|
|
length: 4,
|
|
// initialIndex: selectedIndex.value,
|
|
child: Column(children: [
|
|
CommonTabBar(tabs: [
|
|
const Tab(
|
|
text: 'All',
|
|
),
|
|
Tab(
|
|
child: Row(children: [
|
|
commonGlassContainer(
|
|
borderColor: const Color(0xFF1E3A46),
|
|
opacity1: 0.05,
|
|
opacity2: 0.06,
|
|
width: 30.w,
|
|
height: 30.h,
|
|
borderradius: 100,
|
|
customWidget: Center(
|
|
child: Image.asset(
|
|
"assets/images/png/f7_hand-thumbsup.png",
|
|
height: 17.h,
|
|
width: 17.w,
|
|
),
|
|
),
|
|
border: 1.71),
|
|
const Spacer(),
|
|
text14400white("110K"),
|
|
]),
|
|
),
|
|
Tab(
|
|
child: Row(children: [
|
|
commonGlassContainer(
|
|
borderColor: const Color(0xFF1E3A46),
|
|
opacity1: 0.05,
|
|
opacity2: 0.06,
|
|
width: 30.w,
|
|
height: 30.h,
|
|
borderradius: 100,
|
|
customWidget: Center(
|
|
child: Image.asset(
|
|
"assets/images/png/heart 2.png",
|
|
height: 17.h,
|
|
width: 17.w,
|
|
),
|
|
),
|
|
border: 1.71),
|
|
const Spacer(),
|
|
text14400white("9.7K"),
|
|
]),
|
|
),
|
|
Tab(
|
|
child: Row(children: [
|
|
commonGlassContainer(
|
|
borderColor: const Color(0xFF1E3A46),
|
|
opacity1: 0.05,
|
|
opacity2: 0.06,
|
|
width: 30.w,
|
|
height: 30.h,
|
|
borderradius: 100,
|
|
customWidget: Center(
|
|
child: Image.asset(
|
|
"assets/images/png/party-popper 2.png",
|
|
height: 17.h,
|
|
width: 17.w,
|
|
),
|
|
),
|
|
border: 1.71),
|
|
const Spacer(),
|
|
text14400white("7.4K"),
|
|
]),
|
|
),
|
|
]),
|
|
Expanded(
|
|
child: TabBarView(
|
|
children: [
|
|
allTab(),
|
|
likeTab(),
|
|
favouriteTab(),
|
|
partyTab(),
|
|
],
|
|
),
|
|
),
|
|
sizedBoxHeight(20.h)
|
|
])),
|
|
)
|
|
])
|
|
]));
|
|
}
|
|
|
|
Widget allTab() {
|
|
return Column(
|
|
children: [
|
|
sizedBoxHeight(20.h),
|
|
Expanded(
|
|
child: ListView.builder(
|
|
itemCount: allTabData.length,
|
|
shrinkWrap: true,
|
|
itemBuilder: (context, index) {
|
|
return Column(
|
|
children: [
|
|
commonReaction(
|
|
imagePath: allTabData[index]["imagePath"],
|
|
reactionimg: allTabData[index]["reactionimg"],
|
|
title: allTabData[index]["title"]),
|
|
if (allTabData.length - 1 != index) commonDivider(),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget likeTab() {
|
|
return Column(
|
|
children: [
|
|
sizedBoxHeight(20.h),
|
|
Expanded(
|
|
child: ListView.builder(
|
|
itemCount: allTabData.length,
|
|
shrinkWrap: true,
|
|
itemBuilder: (context, index) {
|
|
return Column(
|
|
children: [
|
|
commonReaction(
|
|
imagePath: allTabData[index]["imagePath"],
|
|
reactionimg: allTabData[index]["reactionimg"],
|
|
title: allTabData[index]["title"]),
|
|
if (allTabData.length - 1 != index) commonDivider(),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget favouriteTab() {
|
|
return Column(
|
|
children: [
|
|
sizedBoxHeight(20.h),
|
|
Expanded(
|
|
child: ListView.builder(
|
|
itemCount: allTabData.length,
|
|
shrinkWrap: true,
|
|
itemBuilder: (context, index) {
|
|
return Column(
|
|
children: [
|
|
commonReaction(
|
|
imagePath: allTabData[index]["imagePath"],
|
|
reactionimg: allTabData[index]["reactionimg"],
|
|
title: allTabData[index]["title"]),
|
|
if (allTabData.length - 1 != index) commonDivider(),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget partyTab() {
|
|
return Column(
|
|
children: [
|
|
sizedBoxHeight(20.h),
|
|
Expanded(
|
|
child: ListView.builder(
|
|
itemCount: allTabData.length,
|
|
shrinkWrap: true,
|
|
itemBuilder: (context, index) {
|
|
return Column(
|
|
children: [
|
|
commonReaction(
|
|
imagePath: allTabData[index]["imagePath"],
|
|
reactionimg: allTabData[index]["reactionimg"],
|
|
title: allTabData[index]["title"]),
|
|
if (allTabData.length - 1 != index) commonDivider(),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget commonReaction(
|
|
{required String imagePath,
|
|
required String reactionimg,
|
|
required String title}) {
|
|
return Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 18.h),
|
|
child: Row(
|
|
children: [
|
|
Stack(children: [
|
|
CircleAvatar(
|
|
radius: 25.r,
|
|
backgroundImage: AssetImage(imagePath),
|
|
),
|
|
Positioned(
|
|
bottom: 0,
|
|
right: 0,
|
|
child: Container(
|
|
height: 22.h,
|
|
width: 22.w,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: const Color(0xFF1E3A46),
|
|
border: Border.all(
|
|
color: const Color(0xFFFCFCFC).withOpacity(0.18),
|
|
width: 0.6)),
|
|
child: Center(
|
|
child: Image.asset(
|
|
reactionimg,
|
|
height: 12.h,
|
|
width: 12.w,
|
|
),
|
|
),
|
|
)),
|
|
]),
|
|
sizedBoxWidth(10.w),
|
|
text17400white(title),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|