Files
Regroup/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart
2024-07-01 19:58:39 +05:30

149 lines
5.0 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.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';
class AccountSettings extends StatefulWidget {
const AccountSettings({super.key});
@override
State<AccountSettings> createState() => _AccountSettingsState();
}
class _AccountSettingsState extends State<AccountSettings> {
bool swichvalue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Account settings",
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/images/png/Ellipse 1496.png",
),
fit: BoxFit.fill)),
),
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: text18w700_FCFCFC("Sign in & security"),
),
sizedBoxHeight(20.h),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
child: Row(children: [
Image.asset(
"assets/images/png/eyeIcon.png",
height: 21.h,
width: 21.w,
),
sizedBoxWidth(12.w),
text16w400_FCFCFC("Account visibility"),
Spacer(),
Transform.scale(
scale: 0.9,
child: CupertinoSwitch(
value: swichvalue,
trackColor: Colors.white.withOpacity(0.4),
activeColor: Color(0xFF34C759),
onChanged: (bool? value) {
setState(() {
swichvalue = value ?? false;
});
}))
]),
),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.changepassword);
},
child: rowTile(
imagePath: "assets/images/png/BlackPass.png",
text: "Change password"),
),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.accaountsession);
},
child: rowTile(
imagePath: "assets/images/png/clock.png",
text: "Account sessions"),
),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.blockedusers);
},
child: rowTile(
imagePath: "assets/images/png/blocked.png",
text: "Blocked users"),
),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.deleteaccount);
},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
child: Row(children: [
Image.asset(
"assets/images/png/deleteIcon (2).png",
height: 21.h,
width: 21.w,
),
sizedBoxWidth(12.w),
text16w400_FF0000("Delete account"),
]),
),
)
]))
]));
}
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,
)
]),
);
}
}