FIX_Mobile View Alignment

This commit is contained in:
sanjeev.p 2026-03-17 11:03:53 +05:30
parent 24f532f750
commit da493a11da
3 changed files with 77 additions and 112 deletions

View File

@ -208,7 +208,8 @@ class _changesPasswordState extends State<changesPassword> {
body: SingleChildScrollView( body: SingleChildScrollView(
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: Container( child: Container(
constraints: BoxConstraints(minHeight: _size.height), height: Responsive.isDesktop(context) ? null : _size.height,
constraints: Responsive.isDesktop(context) ? BoxConstraints(minHeight: _size.height) : null,
color: Colors.white, color: Colors.white,
child: Stack( child: Stack(
children: [ children: [
@ -295,7 +296,7 @@ class _changesPasswordState extends State<changesPassword> {
// ), // ),
Container( Container(
margin: marginInsets, margin: marginInsets,
alignment: Alignment.topCenter, alignment: Responsive.isDesktop(context) ? Alignment.topCenter : Alignment.bottomCenter,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Form( child: Form(
key: _formKey, key: _formKey,
@ -664,7 +665,7 @@ class _changesPasswordState extends State<changesPassword> {
// height: _size.height * 0.1, // height: _size.height * 0.1,
// ), // ),
Container( Container(
alignment: Alignment.center, alignment: Responsive.isDesktop(context) ? Alignment.center : Alignment.bottomCenter,
padding: padding:
EdgeInsets.symmetric(vertical: 8), EdgeInsets.symmetric(vertical: 8),
child: RichText( child: RichText(

View File

@ -934,7 +934,7 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
), ),
Container( Container(
margin: marginInsets, margin: marginInsets,
alignment: Alignment.center, alignment: Responsive.isDesktop(context) ? Alignment.center : Alignment.bottomCenter,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Form( child: Form(
key: _formKey, key: _formKey,
@ -1275,13 +1275,13 @@ class _MyEmailVerifyState extends State<MyEmailVerify> {
SizedBox( SizedBox(
height: Responsive.isDesktop(context) height: Responsive.isDesktop(context)
? _size.height * 0.2 ? _size.height * 0.2
: _size.height * 0.15, : _size.height * 0.3,
), ),
// SizedBox( // SizedBox(
// height: _size.height * 0.1, // height: _size.height * 0.1,
// ), // ),
Container( Container(
alignment: Alignment.center, alignment: Responsive.isDesktop(context) ? Alignment.center : Alignment.bottomCenter,
padding: padding:
EdgeInsets.symmetric(vertical: 8), EdgeInsets.symmetric(vertical: 8),
child: RichText( child: RichText(

View File

@ -1097,7 +1097,7 @@ class _loginState extends State<login> {
child: Image.asset( child: Image.asset(
'assets/nhance_app_logo.png', 'assets/nhance_app_logo.png',
width: 150, width: 150,
height: 150, height: Responsive.isDesktop(context) ? 150 : 100,
)), )),
), ),
if (!Responsive.isMobile(context) && if (!Responsive.isMobile(context) &&
@ -1148,7 +1148,7 @@ class _loginState extends State<login> {
), ),
Container( Container(
margin: marginInsets, margin: marginInsets,
alignment: Alignment.center, alignment: Responsive.isDesktop(context) ? Alignment.center : Alignment.bottomCenter,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Form( child: Form(
key: _formKey, key: _formKey,
@ -1159,7 +1159,9 @@ class _loginState extends State<login> {
Expanded( Expanded(
flex: _size.width < 1100 ? 6 : 12, flex: _size.width < 1100 ? 6 : 12,
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 20), margin: _size.width > 1100
? EdgeInsets.only(left: 20, right: 20)
: EdgeInsets.only(left: 0, right: 0),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
@ -1675,114 +1677,76 @@ class _loginState extends State<login> {
}, },
), ),
), ),
if (otpFieldShow && if (otpFieldShow && clickedForgotPassword) ...[
clickedForgotPassword) ...[
const SizedBox(height: 10), const SizedBox(height: 10),
Column( AnimatedSwitcher(
crossAxisAlignment: duration: const Duration(milliseconds: 500),
CrossAxisAlignment.start, switchInCurve: Curves.easeInOutCirc,
children: [ switchOutCurve: Curves.easeOutCirc,
Center( child: Column(
child: Text( key: const ValueKey('otp_block'),
'OTP', crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( children: [
fontSize: Responsive Center(
.isMobile(
context)
? 14
: 18,
fontWeight:
FontWeight
.w600,
color:
Colors.black,
),
),
),
const SizedBox(
height: 10),
Container(
alignment:
Alignment.center,
margin: Responsive
.isDesktop(
context)
? const EdgeInsets
.symmetric(
horizontal:
150)
: const EdgeInsets
.symmetric(
horizontal:
0),
child: Pinput(
length: 6,
inputFormatters: [
FilteringTextInputFormatter
.digitsOnly,
],
keyboardType:
TextInputType
.number,
showCursor: true,
controller:
_otpController,
validator:
(value) {
if (value ==
null ||
value
.isEmpty) {
return 'Please enter OTP';
}
if (value
.length <
6) {
return 'OTP must be 6 digits';
}
return null;
},
),
),
const SizedBox(
height: 10),
Container(
margin: Responsive
.isDesktop(
context)
? const EdgeInsets
.symmetric(
horizontal:
150)
: const EdgeInsets
.symmetric(
horizontal:
0),
alignment: Alignment
.centerRight,
child: InkWell(
onTap: () {
setState(() {
otpFieldShow =
false;
});
resendOTP();
},
mouseCursor:
SystemMouseCursors
.click,
child: Text( child: Text(
'Didnt Receive Code?', 'OTP',
style: GoogleFonts style: TextStyle(
.poppins( fontSize: Responsive.isMobile(context) ? 14 : 18,
color: Colors fontWeight: FontWeight.w600,
.blue, color: Colors.black,
fontSize: 14,
), ),
), ),
), ),
), const SizedBox(height: 10),
], Container(
alignment: Alignment.center,
margin: Responsive.isDesktop(context)
? const EdgeInsets.symmetric(horizontal: 150)
: const EdgeInsets.symmetric(horizontal: 0),
child: Pinput(
length: 6,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
],
keyboardType: TextInputType.number,
showCursor: true,
controller: _otpController,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter OTP';
}
if (value.length < 6) {
return 'OTP must be 6 digits';
}
return null;
},
),
),
const SizedBox(height: 10),
Container(
margin: Responsive.isDesktop(context)
? const EdgeInsets.symmetric(horizontal: 150)
: const EdgeInsets.symmetric(horizontal: 0),
alignment: Alignment.centerRight,
child: InkWell(
onTap: () {
setState(() {
otpFieldShow = false;
});
resendOTP();
},
mouseCursor: SystemMouseCursors.click,
child: Text(
'Didn\'t Receive Code?',
style: GoogleFonts.poppins(
color: Colors.blue,
fontSize: 14,
),
),
),
),
],
),
), ),
], ],
SizedBox(height: 20), SizedBox(height: 20),