Files
Regroup/lib/Feed Module/Notification/View/notification.dart
2024-06-14 19:25:56 +05:30

252 lines
9.0 KiB
Dart
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/CustomNextButton.dart';
import 'package:regroup/Utils/Common/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
class NotificationPage extends StatefulWidget {
const NotificationPage({super.key});
@override
State<NotificationPage> createState() => _NotificationPageState();
}
class _NotificationPageState extends State<NotificationPage> {
List notificationcontents = [
{
'image': "assets/images/png/notification1.png",
'follow': false,
'name': 'Lorem Ipsum is simply dummy text of \nthe printing and . . . ',
'messagereq': true,
},
{
'image': "assets/images/png/notification2.png",
'follow': true,
'name': 'Davis Bothman',
'messagereq': false,
},
{
'image': "assets/images/png/notification3.png",
'follow': false,
'name': 'Lorem Ipsum is simply dummy \ntext of the printing and . . . ',
'messagereq': false,
},
{
'image': "assets/images/png/notification2.png",
'follow': true,
'name': 'Davis Bothman',
'messagereq': false,
},
{
'image': "assets/images/png/notification3.png",
'follow': false,
'name': 'Lorem Ipsum is simply dummy \ntext of the printing and . . . ',
'messagereq': false,
},
];
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
appBar: CommonAppbar(
titleTxt: 'Notifications',
),
body: Stack(
children: [
// const CommonBlurLeftRed(),
Positioned(top: 10, left: -30, child: CommonBlurLeftSecond()),
// const CommonBlurRightRed(),
// const CommonBlurLeft(),
Positioned(top: 150, right: -30, child: CommonBlurRightSecond()),
Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()),
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: Column(
children: [
ListView.separated(
separatorBuilder: (context, index) {
return Divider(
thickness: 0.6.h,
color: Color(0xffFFFFFF).withOpacity(0.72),
);
},
itemCount: notificationcontents.length,
shrinkWrap: true,
padding: const EdgeInsets.only(top: 10.0),
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Notificationlist(
name: notificationcontents[index]['name'],
followrequest: notificationcontents[index]['follow'],
imageurl: notificationcontents[index]['image'],
msgrequest: notificationcontents[index]['messagereq'],
);
},
),
],
)),
],
),
);
}
}
class Notificationlist extends StatefulWidget {
final String imageurl;
final bool msgrequest;
final String name;
final bool followrequest;
// const Notificationlist({super.key});
Notificationlist({
Key? key,
required this.imageurl,
required this.msgrequest,
required this.name,
required this.followrequest,
}) : super(key: key);
@override
State<Notificationlist> createState() => _NotificationlistState();
}
class _NotificationlistState extends State<Notificationlist> {
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 60,
height: 60,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(widget.imageurl),
fit: BoxFit.fill,
),
),
),
sizedBoxWidth(10.w),
widget.msgrequest == true
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14400white(widget.name),
sizedBoxHeight(6.h),
text12400white('3 mins ago'),
sizedBoxHeight(10.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: 135.w,
height: 30.h,
child:
CustomButton(text: 'Accept', onPressed: () {})),
sizedBoxWidth(10.w),
SizedBox(
width: 135.w,
height: 30.h,
child: CustomButton2(
text: 'Message', onPressed: () {}))
],
)
],
)
: widget.followrequest == true
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14700white(widget.name),
sizedBoxHeight(3.h),
text12400white('wants to follow you'),
sizedBoxHeight(6.h),
text12400white('3 mins ago'),
],
),
sizedBoxWidth(10.w),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: 80.w,
height: 30.h,
child: CustomButton(
text: 'Confirm', onPressed: () {})),
sizedBoxWidth(10.w),
SizedBox(
width: 80.w,
height: 30.h,
child: CustomButton2(
text: 'Delete', onPressed: () {}))
],
)
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14400white(widget.name),
sizedBoxHeight(6.h),
text12400white('3 mins ago'),
],
),
sizedBoxWidth(25.w),
Image.asset(
'assets/images/png/notifcation.png',
width: 60.w,
height: 60.h,
)
],
)
],
),
);
}
}