195 lines
6.2 KiB
Dart
195 lines
6.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.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/CommonAppbar.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:shared_preferences/shared_preferences.dart';
|
|
|
|
class Settings extends StatefulWidget {
|
|
const Settings({super.key});
|
|
|
|
@override
|
|
State<Settings> createState() => _SettingsState();
|
|
}
|
|
|
|
class _SettingsState extends State<Settings> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
// key: _scaffoldKey1,
|
|
backgroundColor: Color(0xFF222935),
|
|
extendBody: true,
|
|
resizeToAvoidBottomInset: false,
|
|
appBar: CommonAppbar(
|
|
titleTxt: "Settings",
|
|
),
|
|
body: Stack(children: [
|
|
Container(
|
|
decoration: const BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
|
fit: BoxFit.fill)),
|
|
),
|
|
Column(children: [
|
|
GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.accountsettings);
|
|
},
|
|
child: rowTile(
|
|
imagePath: "assets/images/png/codicon_account.png",
|
|
text: "Account settings",
|
|
),
|
|
),
|
|
commonDivider(),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.notifications);
|
|
},
|
|
child: rowTile(
|
|
imagePath: "assets/images/png/Frame 9.png",
|
|
text: "Notification settings",
|
|
),
|
|
),
|
|
commonDivider(),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.editProfile);
|
|
},
|
|
child: rowTile(
|
|
imagePath: "assets/images/png/edit 1.png",
|
|
text: "Edit profile",
|
|
),
|
|
),
|
|
commonDivider(),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.helpandsupport);
|
|
},
|
|
child: rowTile(
|
|
imagePath:
|
|
"assets/images/png/fluent_person-support-20-regular.png",
|
|
text: "Help & support",
|
|
),
|
|
),
|
|
commonDivider(),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.privacypolicy);
|
|
},
|
|
child: rowTile(
|
|
imagePath: "assets/images/png/iconoir_privacy-policy.png",
|
|
text: "Privacy policy",
|
|
),
|
|
),
|
|
commonDivider(),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Get.toNamed(RouteName.termscondition);
|
|
},
|
|
child: rowTile(
|
|
imagePath: "assets/images/png/Vector (5)1.png",
|
|
text: "Terms & condition",
|
|
),
|
|
),
|
|
commonDivider(),
|
|
GestureDetector(
|
|
onTap: () {
|
|
dialogwidget();
|
|
},
|
|
child: rowTile(
|
|
imagePath: "assets/images/png/Vector (6).png",
|
|
text: "Logout",
|
|
),
|
|
),
|
|
])
|
|
]));
|
|
}
|
|
|
|
Widget rowTile({
|
|
required String imagePath,
|
|
required String text,
|
|
}) {
|
|
return Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
|
child: Row(children: [
|
|
Image.asset(
|
|
imagePath,
|
|
height: 21.h,
|
|
width: 21.w,
|
|
),
|
|
sizedBoxWidth(12.w),
|
|
text16w400_FCFCFC(text),
|
|
Spacer(),
|
|
Icon(
|
|
Icons.arrow_forward_ios,
|
|
color: Colors.white,
|
|
size: 20,
|
|
)
|
|
]),
|
|
);
|
|
}
|
|
|
|
dialogwidget() {
|
|
Get.dialog(Dialog(
|
|
backgroundColor: Colors.transparent,
|
|
child: commonGlassContainer(
|
|
width: double.infinity,
|
|
height: 200.h,
|
|
borderradius: 14,
|
|
opacity1: 0.09,
|
|
opacity2: 0.13,
|
|
border: 0.8,
|
|
customWidget: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
text18w400_FCFCFC(
|
|
"Are you sure you want to logout of Regroup community?",
|
|
textAlign: TextAlign.center),
|
|
sizedBoxHeight(20.h),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
GestureDetector(
|
|
onTap: () async {
|
|
SharedPreferences prefs =
|
|
await SharedPreferences.getInstance();
|
|
await prefs.clear();
|
|
Get.offAllNamed(RouteName.loginScreen);
|
|
},
|
|
child: commonGlassContainer(
|
|
width: 130.w,
|
|
height: 40.h,
|
|
borderradius: 30.r,
|
|
opacity1: 0.05,
|
|
opacity2: 0.07,
|
|
customWidget:
|
|
Center(child: text14400white("Yes, I want to")),
|
|
border: 1),
|
|
),
|
|
Container(
|
|
height: 40.h,
|
|
width: 130.w,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFFD90B2E),
|
|
borderRadius: BorderRadius.circular(30.r),
|
|
),
|
|
child: Center(child: text14400white("Keep using App")),
|
|
)
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
)));
|
|
}
|
|
}
|