Improve back button function in all screens

This commit is contained in:
hanie.khodkari
2025-03-19 18:38:40 +03:30
parent d99ecb2783
commit 58cd3d9f3f
35 changed files with 4715 additions and 5007 deletions
+35 -42
View File
@@ -52,51 +52,44 @@ class _LabelDetailScreenState extends State<LabelDetailScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Label dos\'nt exists!'),
)
: LabelDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
}),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Label dos\'nt exists!'),
)
: LabelDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
}),
),
);
}