Merge branch 'doctor-app-design' into 'development'

Doctor app design

See merge request Cloud_Solution/doctor_app_flutter!913
merge-requests/914/merge
Elham Ali 3 years ago
commit 2ff5fbad7c

@ -12,9 +12,8 @@ class SizeConfig {
static double textMultiplier;
static double imageSizeMultiplier;
static double heightMultiplier;
static double widthMultiplier;
static bool isPortrait = true;
static double widthMultiplier;
static bool isMobilePortrait = false;
static bool isMobile = false;
static bool isHeightShort = false;
@ -75,8 +74,6 @@ class SizeConfig {
print('widthMultiplier $widthMultiplier');
print('isPortrait $isPortrait');
print('isMobilePortrait $isMobilePortrait');
}
static getTextMultiplierBasedOnWidth({double width}) {
@ -102,5 +99,4 @@ class SizeConfig {
}
return heightMultiplier;
}
}

@ -36,7 +36,8 @@ class MyApp extends StatelessWidget {
SizeConfig().init(constraints, orientation);
return MultiProvider(
providers: [
ChangeNotifierProvider<AuthenticationViewModel>(create: (context) => AuthenticationViewModel()),
ChangeNotifierProvider<AuthenticationViewModel>(
create: (context) => AuthenticationViewModel()),
ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(),
),
@ -67,7 +68,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.grey,
primaryColor: Colors.grey,
buttonColor: HexColor('#B8382C'),
buttonColor: HexColor('#D02127'),
fontFamily: 'Poppins',
dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255, 255, 255, 1),

@ -16,7 +16,6 @@ import 'package:provider/provider.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class LoginScreen extends StatefulWidget {
@override
_LoginScreenState createState() => _LoginScreenState();
@ -55,14 +54,11 @@ class _LoginScreenState extends State<LoginScreen> {
children: <Widget>[
//TODO Use App Text rather than text
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 30,
@ -70,49 +66,38 @@ class _LoginScreenState extends State<LoginScreen> {
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start, children: [
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Text(
TranslationBase
.of(context)
.welcomeTo,
TranslationBase.of(context).welcomeTo,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight
.w600,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins'),
),
Text(
TranslationBase
.of(context)
TranslationBase.of(context)
.drSulaimanAlHabib,
style: TextStyle(
color:Color(0xFF2B353E),
fontWeight: FontWeight
.bold,
fontSize: SizeConfig
.isMobile
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.isMobile
? 24
: SizeConfig
.realScreenWidth *
: SizeConfig.realScreenWidth *
0.029,
fontFamily: 'Poppins'),
),
Text(
"Doctor App",
style: TextStyle(
fontSize:
SizeConfig.isMobile
fontSize: SizeConfig.isMobile
? 16
: SizeConfig
.realScreenWidth *
: SizeConfig.realScreenWidth *
0.030,
fontWeight: FontWeight
.w600,
fontWeight: FontWeight.w600,
color: Color(0xFFD02127)),
),
]),
@ -124,79 +109,69 @@ class _LoginScreenState extends State<LoginScreen> {
Form(
key: loginFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment
.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: SizeConfig
.realScreenWidth * 0.90,
height: SizeConfig
.realScreenHeight * 0.65,
child:
Column(
crossAxisAlignment: CrossAxisAlignment
.start, children: [
width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight * 0.65,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterId,
hintText:
TranslationBase.of(context).enterId,
hasBorder: true,
controller: userIdController,
onChanged: (value){
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.userID =
value
.trim();
.userID = value.trim();
});
},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterPassword,
hintText: TranslationBase.of(context)
.enterPassword,
hasBorder: true,
isSecure: true,
controller: passwordController,
onChanged: (value){
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.password =
value
.trim();
.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(
authenticationViewModel.userInfo
.userID);
authenticationViewModel
.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: (){
},
onClick: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectYourProject,
hintText: TranslationBase.of(context)
.selectYourProject,
hasBorder: true,
controller: projectIdController,
isTextFieldHasSuffix: true,
enabled: false,
onClick: (){
Helpers
.showCupertinoPicker(
onClick: () {
Helpers.showCupertinoPicker(
context,
projectsList,
'facilityName',
onSelectProject,
authenticationViewModel);
},
),
buildSizedBox()
]),
@ -210,7 +185,6 @@ class _LoginScreenState extends State<LoginScreen> {
]),
),
bottomSheet: Container(
height: 90,
width: double.infinity,
child: Center(
@ -220,26 +194,23 @@ class _LoginScreenState extends State<LoginScreen> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
AppButton(
title: TranslationBase
.of(context)
.login,
title: TranslationBase.of(context).login,
color: Color(0xFFD02127),
fontWeight: FontWeight.w700,
disabled: authenticationViewModel.userInfo
.userID == null ||
authenticationViewModel.userInfo
.password ==
null,
fontWeight: FontWeight.w600,
disabled: authenticationViewModel.userInfo.userID == null ||
authenticationViewModel.userInfo.password == null,
onPressed: () {
login(context);
},
),
SizedBox(height: 25,)
SizedBox(
height: 25,
)
],
),
),
),),
),
),
);
}
@ -249,7 +220,9 @@ class _LoginScreenState extends State<LoginScreen> {
);
}
login(context,) async {
login(
context,
) async {
if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save();
GifLoaderDialogUtils.showMyDialog(context);
@ -259,7 +232,7 @@ class _LoginScreenState extends State<LoginScreen> {
Helpers.showErrorToast(authenticationViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
authenticationViewModel.setUnverified(true,isFromLogin: true);
authenticationViewModel.setUnverified(true, isFromLogin: true);
// Navigator.of(context).pushReplacement(
// MaterialPageRoute(
// builder: (BuildContext context) =>
@ -275,22 +248,25 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) {
setState(() {
authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
authenticationViewModel.userInfo.projectID =
projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName;
});
primaryFocus.unfocus();
}
String memberID ="";
getProjects(memberID)async {
String memberID = "";
getProjects(memberID) async {
if (memberID != null && memberID != '') {
if (this.memberID !=memberID) {
if (this.memberID != memberID) {
this.memberID = memberID;
await authenticationViewModel.getHospitalsList(memberID);
if(authenticationViewModel.state == ViewState.Idle) {
if (authenticationViewModel.state == ViewState.Idle) {
projectsList = authenticationViewModel.hospitals;
setState(() {
authenticationViewModel.userInfo.projectID = projectsList[0].facilityId;
authenticationViewModel.userInfo.projectID =
projectsList[0].facilityId;
projectIdController.text = projectsList[0].facilityName;
});
}

@ -29,7 +29,7 @@ class PrescriptionInPatientWidget extends StatelessWidget {
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border:
Border.all(color: HexColor('#B8382C'), width: 4),
Border.all(color: HexColor('#D02127'), width: 4),
borderRadius: BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(

@ -1,3 +1,5 @@
import 'dart:ui';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@ -54,10 +56,13 @@ class _AppButtonState extends State<AppButton> {
// height: MediaQuery.of(context).size.height * 0.075,
height: widget.height,
child: IgnorePointer(
ignoring: widget.loading ||widget.disabled,
ignoring: widget.loading || widget.disabled,
child: RawMaterialButton(
fillColor: widget.disabled
? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"),
? Colors.grey
: widget.color != null
? widget.color
: HexColor("#D02127"),
splashColor: widget.color,
child: Padding(
padding: (widget.hPadding > 0 || widget.vPadding > 0)
@ -103,18 +108,21 @@ class _AppButtonState extends State<AppButton> {
widget.title,
color: widget.fontColor,
fontSize: SizeConfig.textMultiplier * widget.fontSize,
fontWeight: widget.fontWeight,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
],
),
),
onPressed: widget.disabled ? (){} : widget.onPressed,
onPressed: widget.disabled ? () {} : widget.onPressed,
shape: RoundedRectangleBorder(
side: BorderSide(
color:
widget.hasBorder ? widget.borderColor : widget.disabled
? Colors.grey : widget.color ?? Color(0xFFB8382C),
color: widget.hasBorder
? widget.borderColor
: widget.disabled
? Colors.grey
: widget.color ?? Color(0xFFB8382C),
width: 0.8,
),
borderRadius: BorderRadius.all(Radius.circular(widget.radius))),

@ -102,7 +102,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Color(0Xffffffff),
widget.validationError == null
? Color(0xFFEFEFEF)
: Colors.red.shade700)
: Colors.red.shade700,
)
: null,
padding:
EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0),
@ -116,8 +117,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
padding: widget.dropDownText == null
? widget.isSearchTextField
? EdgeInsets.only(top: 10)
: EdgeInsets.symmetric(vertical: 0)
: EdgeInsets.symmetric(vertical: 0), // 8.0
: EdgeInsets.only(top: 7.5)
: EdgeInsets.only(top: 0), // 8.0
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
@ -130,10 +131,13 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
// marginTop: widget.hasHintmargin ? 0 : 30,
color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false
? SizeConfig.getHeightMultiplier() *
(SizeConfig.isWidthLarge ? 1.1 : 1.3)
? 11.0
// SizeConfig.getHeightMultiplier() *
// (SizeConfig.isWidthLarge ? 1.1 : 1.3)
: 0,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w500,
letterSpacing: -0.44,
fontFamily: 'Poppins',
),
widget.dropDownText == null
? Container(
@ -146,14 +150,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? TextAlign.right
: TextAlign.left,
focusNode: _focusNode,
textAlignVertical: TextAlignVertical.center,
textAlignVertical: TextAlignVertical.top,
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
widget.hintText, null, true),
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7,
fontSize:
14.0, //SizeConfig.textMultiplier * 1.7,
fontFamily: 'Poppins',
color: Color(0xFF575757),
fontWeight: FontWeight.w400,
letterSpacing: -0.56,
),
controller: widget.controller,
keyboardType: widget.inputType ??
@ -202,7 +209,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Icons.keyboard_arrow_down,
color: widget.dropDownColor != null
? widget.dropDownColor
: Colors.black,
: Color(0xff2E303A),
size: 12.0,
),
)
: Container(),

@ -1,10 +1,9 @@
import 'package:flutter/material.dart';
class TextFieldsUtils{
class TextFieldsUtils {
static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor,
{double borderWidth = -1, double borderRadius = 12}) {
{double borderWidth = -1, double borderRadius = 10.0}) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
@ -46,11 +45,13 @@ class TextFieldsUtils{
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),*/
hintText: selectedText != null ? selectedText : hintText??"",
suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,),
hintText: selectedText != null ? selectedText : hintText ?? "",
suffixIcon: Icon(
suffixIcon ?? null,
color: Colors.grey.shade600,
),
hintStyle: TextStyle(
fontSize: 14,
fontSize: 11,
color: Colors.grey.shade600,
),
);

Loading…
Cancel
Save