TF-2387 Handle system back button on login view mobile
This commit is contained in:
@@ -26,44 +26,50 @@ class LoginView extends BaseLoginView {
|
||||
Widget build(BuildContext context) {
|
||||
ThemeUtils.setSystemDarkUIStyle();
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.primaryLightColor,
|
||||
body: GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
child: SafeArea(
|
||||
child: _supportScrollForm(context)
|
||||
? Stack(children: [
|
||||
Center(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: _buildCenterForm(context)
|
||||
)
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.isBackButtonActivated) {
|
||||
return LoginBackButton(
|
||||
onBackAction: () => controller.handleBackButtonAction(context)
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
})
|
||||
])
|
||||
: Stack(children: [
|
||||
_buildCenterForm(context),
|
||||
Obx(() {
|
||||
if (controller.isBackButtonActivated) {
|
||||
return LoginBackButton(
|
||||
onBackAction: () => controller.handleBackButtonAction(context)
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
})
|
||||
]),
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) => !didPop
|
||||
? controller.handleBackButtonAction(context)
|
||||
: null,
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColor.primaryLightColor,
|
||||
body: GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
child: SafeArea(
|
||||
child: _supportScrollForm(context)
|
||||
? Stack(children: [
|
||||
Center(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: _buildCenterForm(context)
|
||||
)
|
||||
),
|
||||
Obx(() {
|
||||
if (controller.isBackButtonActivated) {
|
||||
return LoginBackButton(
|
||||
onBackAction: () => controller.handleBackButtonAction(context)
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
})
|
||||
])
|
||||
: Stack(children: [
|
||||
_buildCenterForm(context),
|
||||
Obx(() {
|
||||
if (controller.isBackButtonActivated) {
|
||||
return LoginBackButton(
|
||||
onBackAction: () => controller.handleBackButtonAction(context)
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
})
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCenterForm(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user