mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 07:24:55 +00:00
add PopScope to setting page
This commit is contained in:
@ -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 {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user