Merge branch 'master' of https://gitlab.com/Cloud_Solution/doctor_app_flutter
commit
c53439f014
@ -0,0 +1,54 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class SizeConfig {
|
||||
static double _blockWidth = 0;
|
||||
static double _blockHeight = 0;
|
||||
|
||||
static double screenWidth;
|
||||
static double screenHeight;
|
||||
static double textMultiplier;
|
||||
static double imageSizeMultiplier;
|
||||
static double heightMultiplier;
|
||||
static double widthMultiplier;
|
||||
|
||||
static bool isPortrait = true;
|
||||
static bool isMobilePortrait = false;
|
||||
static bool isMobile = false;
|
||||
|
||||
void init(BoxConstraints constraints, Orientation orientation) {
|
||||
|
||||
screenHeight = constraints.maxHeight;
|
||||
screenWidth = constraints.maxWidth;
|
||||
|
||||
_blockWidth = screenWidth / 100;
|
||||
_blockHeight = screenHeight / 100;
|
||||
if(constraints.maxWidth<= MAX_SMALL_SCREEN){
|
||||
isMobile = true;
|
||||
}
|
||||
if (orientation == Orientation.portrait) {
|
||||
isPortrait = true;
|
||||
if (screenWidth < 450) {
|
||||
isMobilePortrait = true;
|
||||
}
|
||||
textMultiplier = _blockHeight;
|
||||
imageSizeMultiplier = _blockWidth;
|
||||
} else {
|
||||
isPortrait = false;
|
||||
isMobilePortrait = false;
|
||||
textMultiplier = _blockWidth;
|
||||
imageSizeMultiplier = _blockHeight;
|
||||
}
|
||||
heightMultiplier = _blockHeight;
|
||||
widthMultiplier = _blockWidth;
|
||||
|
||||
print('screenWidth $screenWidth');
|
||||
print('screenHeight $screenHeight');
|
||||
print('textMultiplier $textMultiplier');
|
||||
print('imageSizeMultiplier $imageSizeMultiplier');
|
||||
print('heightMultiplier$heightMultiplier');
|
||||
print('widthMultiplier $widthMultiplier');
|
||||
print('isPortrait $isPortrait');
|
||||
print('isMobilePortrait $isMobilePortrait');
|
||||
}
|
||||
}
|
||||
@ -1 +1 @@
|
||||
enum loginType { knownUser, unknownUser }
|
||||
enum loginType { knownUser, unknownUser, changePassword, verifyPassword }
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
import 'package:doctor_app_flutter/lookups/auth_lookup.dart';
|
||||
import 'package:doctor_app_flutter/widgets/auth/auth_header.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../widgets/auth/change_password.dart';
|
||||
class ChangePasswordScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// return Container()];
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AuthHeader(loginType.changePassword),
|
||||
ChangePassword(),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
import 'package:doctor_app_flutter/lookups/auth_lookup.dart';
|
||||
import 'package:doctor_app_flutter/widgets/auth/auth_header.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VerifyAccountScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// return Container()];
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AuthHeader(loginType.verifyPassword),
|
||||
// ChangePassword(),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,159 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
class ChangePassword extends StatelessWidget {
|
||||
final changePassFormKey = GlobalKey<FormState>();
|
||||
var changePassFormValues = {
|
||||
'currentPass': null,
|
||||
'newPass': null,
|
||||
'repeatedPass': null
|
||||
};
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Form(
|
||||
key: changePassFormKey,
|
||||
child: Container(
|
||||
width: SizeConfig.widthMultiplier * 90,
|
||||
child:
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <
|
||||
Widget>[
|
||||
buildSizedBox(),
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
// ts/images/password_icon.png
|
||||
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
||||
hintText: 'Current Password',
|
||||
hintStyle:
|
||||
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide:
|
||||
BorderSide(color: Theme.of(context).primaryColor),
|
||||
)
|
||||
//BorderRadius.all(Radius.circular(20));
|
||||
),
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Please enter your Current Password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onSaved: (value) {
|
||||
// changePassFormValues. = value;
|
||||
},
|
||||
),
|
||||
buildSizedBox(40),
|
||||
// buildSizedBox(),
|
||||
Text(
|
||||
"New Password",
|
||||
style: TextStyle(
|
||||
fontSize: 2.8 * SizeConfig.textMultiplier,
|
||||
fontWeight: FontWeight.w800),
|
||||
),
|
||||
buildSizedBox(10.0),
|
||||
// Text()
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
// ts/images/password_icon.png
|
||||
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
||||
hintText: 'New Password',
|
||||
hintStyle:
|
||||
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide:
|
||||
BorderSide(color: Theme.of(context).primaryColor),
|
||||
)
|
||||
//BorderRadius.all(Radius.circular(20));
|
||||
),
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Please enter your New Password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onSaved: (value) {
|
||||
// userInfo.UserID = value;
|
||||
},
|
||||
),
|
||||
buildSizedBox(),
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
||||
hintText: 'Repeat Password',
|
||||
hintStyle:
|
||||
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide:
|
||||
BorderSide(color: Theme.of(context).primaryColor),
|
||||
)
|
||||
//BorderRadius.all(Radius.circular(20));
|
||||
),
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Please enter your Repeat Password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onSaved: (value) {
|
||||
// userInfo.UserID = value;
|
||||
},
|
||||
),
|
||||
buildSizedBox(),
|
||||
RaisedButton(
|
||||
onPressed:changePass,
|
||||
elevation: 0.0,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Change Password'
|
||||
.toUpperCase(),
|
||||
// textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 2.5 * SizeConfig.textMultiplier),
|
||||
),
|
||||
),
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
])));
|
||||
}
|
||||
|
||||
SizedBox buildSizedBox([double height = 20]) {
|
||||
return SizedBox(
|
||||
height: height,
|
||||
);
|
||||
}
|
||||
changePass(){
|
||||
if(changePassFormKey.currentState.validate()){
|
||||
changePassFormKey.currentState.save();
|
||||
// call Api
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue