add PopScope to setting page

This commit is contained in:
mohammad
2025-05-15 12:35:47 +03:00
parent a04beb32f2
commit 5d1b8e39b0

View File

@ -22,7 +22,15 @@ class SettingProfilePage extends StatelessWidget {
Widget build(BuildContext context) {
var spaces = HomeCubit.getInstance().spaces;
return DefaultScaffold(
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) {
return;
}
Navigator.of(context).pop(true);
},
child: DefaultScaffold(
title: 'Device Settings',
leading: IconButton(
onPressed: () {
@ -86,15 +94,18 @@ class SettingProfilePage extends StatelessWidget {
const SizedBox(width: 5),
InkWell(
onTap: () {
_bloc.add(const ChangeNameEvent(value: true));
_bloc.add(
const ChangeNameEvent(value: true));
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
padding:
EdgeInsets.symmetric(horizontal: 10),
child: SvgPicture.asset(
Assets.sosEditProfile,
color: Colors.grey,
fit: BoxFit.contain,
height: MediaQuery.of(context).size.height *
height:
MediaQuery.of(context).size.height *
0.02,
),
),
@ -117,7 +128,8 @@ class SettingProfilePage extends StatelessWidget {
if (HomeCubit.visitorPasswordManagement) {
bool? val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => LocationSettingPage(
builder: (context) =>
LocationSettingPage(
space: spaces!.first,
deviceId: device?.uuid ?? '',
)),
@ -128,7 +140,8 @@ class SettingProfilePage extends StatelessWidget {
}
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const SizedBox(
child: Text('Location'),
@ -159,6 +172,7 @@ class SettingProfilePage extends StatelessWidget {
},
),
),
),
);
}