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,108 +1677,69 @@ 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,
switchOutCurve: Curves.easeOutCirc,
child: Column(
key: const ValueKey('otp_block'),
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Center( Center(
child: Text( child: Text(
'OTP', 'OTP',
style: TextStyle( style: TextStyle(
fontSize: Responsive fontSize: Responsive.isMobile(context) ? 14 : 18,
.isMobile( fontWeight: FontWeight.w600,
context) color: Colors.black,
? 14
: 18,
fontWeight:
FontWeight
.w600,
color:
Colors.black,
), ),
), ),
), ),
const SizedBox( const SizedBox(height: 10),
height: 10),
Container( Container(
alignment: alignment: Alignment.center,
Alignment.center, margin: Responsive.isDesktop(context)
margin: Responsive ? const EdgeInsets.symmetric(horizontal: 150)
.isDesktop( : const EdgeInsets.symmetric(horizontal: 0),
context)
? const EdgeInsets
.symmetric(
horizontal:
150)
: const EdgeInsets
.symmetric(
horizontal:
0),
child: Pinput( child: Pinput(
length: 6, length: 6,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter FilteringTextInputFormatter.digitsOnly,
.digitsOnly,
], ],
keyboardType: keyboardType: TextInputType.number,
TextInputType
.number,
showCursor: true, showCursor: true,
controller: controller: _otpController,
_otpController, validator: (value) {
validator: if (value == null || value.isEmpty) {
(value) {
if (value ==
null ||
value
.isEmpty) {
return 'Please enter OTP'; return 'Please enter OTP';
} }
if (value if (value.length < 6) {
.length <
6) {
return 'OTP must be 6 digits'; return 'OTP must be 6 digits';
} }
return null; return null;
}, },
), ),
), ),
const SizedBox( const SizedBox(height: 10),
height: 10),
Container( Container(
margin: Responsive margin: Responsive.isDesktop(context)
.isDesktop( ? const EdgeInsets.symmetric(horizontal: 150)
context) : const EdgeInsets.symmetric(horizontal: 0),
? const EdgeInsets alignment: Alignment.centerRight,
.symmetric(
horizontal:
150)
: const EdgeInsets
.symmetric(
horizontal:
0),
alignment: Alignment
.centerRight,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
otpFieldShow = otpFieldShow = false;
false;
}); });
resendOTP(); resendOTP();
}, },
mouseCursor: mouseCursor: SystemMouseCursors.click,
SystemMouseCursors
.click,
child: Text( child: Text(
'Didnt Receive Code?', 'Didn\'t Receive Code?',
style: GoogleFonts style: GoogleFonts.poppins(
.poppins( color: Colors.blue,
color: Colors
.blue,
fontSize: 14, fontSize: 14,
), ),
), ),
@ -1784,6 +1747,7 @@ class _loginState extends State<login> {
), ),
], ],
), ),
),
], ],
SizedBox(height: 20), SizedBox(height: 20),
Container( Container(