fix sms popup

middle_screen
Elham Rababah 5 years ago
parent a5ea23c38e
commit 3d5bb08adf

@ -19,6 +19,7 @@ class SizeConfig {
static bool isMobile = false;
static bool isHeightShort = false;
static bool isHeightVeryShort = false;
static bool isWidthLarge = false;
void init(BoxConstraints constraints, Orientation orientation) {
realScreenHeight = constraints.maxHeight;
@ -32,20 +33,21 @@ class SizeConfig {
} else if (constraints.maxHeight < 800) {
isHeightShort = true;
}
if(constraints.maxWidth > 600) {
isWidthLarge = true;
}
if (orientation == Orientation.portrait) {
isPortrait = true;
if (realScreenWidth < 450) {
isMobilePortrait = true;
}
// textMultiplier = _blockHeight;
// imageSizeMultiplier = _blockWidth;
screenHeight = realScreenHeight;
screenWidth = realScreenWidth;
} else {
isPortrait = false;
isMobilePortrait = false;
// textMultiplier = _blockWidth;
// imageSizeMultiplier = _blockHeight;
screenHeight = realScreenWidth;
screenWidth = realScreenHeight;
}

@ -24,7 +24,7 @@ class Label extends StatelessWidget {
children: [
AppText(
firstLine,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3 ,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) ,
// fontWeight: FontWeight.bold,
color: color,
fontHeight: .5,

@ -47,6 +47,7 @@ class SMSOTP {
bool isClosed = false;
displayDialog(BuildContext context) async {
double dialogWidth = MediaQuery.of(context).size.width * 0.90;
double dialogInputWidth = (dialogWidth / 4) - (SizeConfig.isWidthLarge?SizeConfig.getWidthMultiplier(width:dialogWidth )* 4.5: 20);
double dialogHeight = SizeConfig.isHeightVeryShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40;
return showDialog(
context: context,
@ -56,6 +57,7 @@ class SMSOTP {
width: dialogWidth,
child: Material(
child: SingleChildScrollView(
child: Center(
child: Container(
color: Colors.white,
child: StatefulBuilder(builder: (context, setState) {
@ -79,14 +81,14 @@ class SMSOTP {
type == AuthMethodTypes.SMS
? DoctorApp.verify_sms_1
: DoctorApp.verify_whtsapp,
size: dialogWidth * 0.13,
size: SizeConfig.getHeightMultiplier(height:dialogHeight) * 9,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
IconButton(
icon: Icon(Icons.close),
iconSize: dialogWidth * 0.13,
iconSize: SizeConfig.getHeightMultiplier(height:dialogHeight) * 15,
onPressed: () {
this.isClosed = true;
Navigator.pop(context);
@ -96,7 +98,7 @@ class SMSOTP {
],
)
]),
SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 10,),
SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * (SizeConfig.isHeightVeryShort?10:5),),
Padding(
padding: EdgeInsets.only(top: 5, right: 5),
child: AppText(
@ -120,7 +122,7 @@ class SMSOTP {
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
width: (dialogWidth / 4) - 20,
width: dialogInputWidth,
height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30,
margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5),
child: TextFormField(
@ -152,7 +154,7 @@ class SMSOTP {
),
),
Container(
width: dialogWidth / 4 - 20,
width: dialogInputWidth,
height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30,
margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5),
@ -186,7 +188,7 @@ class SMSOTP {
),
Container(
margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5),
width: dialogWidth / 4 - 20,
width: dialogInputWidth,
height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30,
child: TextFormField(
focusNode: focusD3,
@ -217,7 +219,7 @@ class SMSOTP {
validator: validateCodeDigit)),
Container(
margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5),
width: dialogWidth / 4 - 20,
width: dialogInputWidth,
height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30,
child: TextFormField(
@ -261,7 +263,7 @@ class SMSOTP {
color: Colors.red,
textAlign: TextAlign.start,
fontWeight: FontWeight.bold,
fontSize: 14,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5,
)
])
],
@ -277,6 +279,7 @@ class SMSOTP {
),
),
),
),
);
}

Loading…
Cancel
Save