mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 22:48:54 +03:30
Improve back button function in all screens
This commit is contained in:
@@ -52,58 +52,51 @@ class _MyPackagesDetailScreenState extends State<MyPackagesDetailScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
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(
|
||||
'My Packages',
|
||||
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(
|
||||
'My Packages',
|
||||
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 Package does\'nt exists!'),
|
||||
)
|
||||
: MyPackageDetailsDataBox(
|
||||
datas: datas!,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
push: () {
|
||||
Navigator.pushNamed(
|
||||
context, Routes.packagesTransferScreen,
|
||||
arguments: datas);
|
||||
},
|
||||
)
|
||||
: 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 Package does\'nt exists!'),
|
||||
)
|
||||
: MyPackageDetailsDataBox(
|
||||
datas: datas!,
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
push: () {
|
||||
Navigator.pushNamed(
|
||||
context, Routes.packagesTransferScreen,
|
||||
arguments: datas);
|
||||
},
|
||||
)
|
||||
: ConnectionErrorBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user