Finish subjective

pull/197/head
Elham Rababah 4 years ago
parent 8eb912af9e
commit bb651478a0

@ -61,7 +61,8 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA;
body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiZjcwMTUyYzktMjAwNy00Y2FjLTkzMWUtOGI0MDlhMWFkNjc4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1ODU1MzAiLCJDbGluaWNJZCI6IjE3Iiwicm9sZSI6IkRPQ1RPUlMiLCJuYmYiOjE2MDg1NTMxMDAsImV4cCI6MTYwOTQxNzEwMCwiaWF0IjoxNjA4NTUzMTAwfQ.lydDI-nsHlmb4Z4vesnckCU1i3hnNayoWVacc3E5_XM";
body['VidaAuthTokenID'] =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGUxMWI1ZGItNTE5Mi00NmIzLWIzMDAtNDMwYjZmNDI4YWExIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU3MjgiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4ODE0MDcyLCJleHAiOjE2MDk2NzgwNzIsImlhdCI6MTYwODgxNDA3Mn0.u23f3ifrNMQrK0ReTZWs9olaZCEYuf06ZZZJsBWJ5LI";
print("URL : $url");
print("Body : ${json.encode(body)}");
@ -78,25 +79,27 @@ class BaseAppClient {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) {
await helpers.logout();
helpers.showErrorToast('Your session expired Please login agian');
} else
if (parsed['MessageStatus'] == 1) {
// if (!parsed['IsAuthenticated']) {
// await helpers.logout();
//
// helpers.showErrorToast('Your session expired Please login agian');
// } else
if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else {
String error =
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];
if (parsed["ValidationErrors"] != null) {
error =
parsed["ValidationErrors"]["StatusMessage"].toString() + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null &&
parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
error ='';
for (var i = 0;
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +"\n";
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +"\n";
}
}
}

@ -86,6 +86,8 @@ const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
var selectedPatientType = 1;

@ -280,7 +280,10 @@ const Map<String, Map<String, String>> localizedValues = {
'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'},
'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'},
"empty-message": {
"en": "Please enter message",
"ar": "يرجى ادخال الموضوع"
"en": "Please enter Value",
"ar": "يرجى ادخال القيمه"
},"chiefComplaintLength": {
"en": "Chief Complaint length should be greater than 25",
"ar": "يجب أن يكون طول شكوى الرئيس أكبر من 25"
},
};

@ -1,14 +1,13 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'base/lookup-service.dart';
class SOAPService extends LookupService {
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
await baseAppClient.post(
GET_ALLERGIES,
@ -27,13 +26,38 @@ class SOAPService extends LookupService {
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
hasError = false;
await baseAppClient.post(POST_ALLERGY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postAllergyRequestModel.toJson());
}
Future postHistories(
PostHistoriesRequestModel postHistoriesRequestModel) async {
hasError = false;
await baseAppClient.post(POST_HISTORY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postHistoriesRequestModel.toJson());
}
Future postChiefComplaint(
PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
hasError = false;
await baseAppClient.post(POST_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postChiefComplaintRequestModel.toJson());
}
}

@ -27,6 +27,7 @@ class LookupService extends BaseService {
List<MasterKeyModel> _historySurgicalList = [];
Future getMasterLookup(MasterKeysService masterKeys) async {
hasError = false;
Map<String, dynamic> body = {
"MasterInput": masterKeys.getMasterKeyService()
};

@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -60,5 +62,25 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postHistories(postHistoriesRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,48 @@
class PostChiefComplaintRequestModel {
int appointmentNo;
int episodeID;
int patientMRN;
String chiefComplaint;
String hopi;
String currentMedication;
bool ispregnant;
bool isLactation;
int numberOfWeeks;
PostChiefComplaintRequestModel(
{this.appointmentNo,
this.episodeID,
this.patientMRN,
this.chiefComplaint,
this.hopi,
this.currentMedication,
this.ispregnant,
this.isLactation,
this.numberOfWeeks});
PostChiefComplaintRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
patientMRN = json['PatientMRN'];
chiefComplaint = json['chiefComplaint'];
hopi = json['Hopi'];
currentMedication = json['CurrentMedication'];
ispregnant = json['ispregnant'];
isLactation = json['isLactation'];
numberOfWeeks = json['numberOfWeeks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['PatientMRN'] = this.patientMRN;
data['chiefComplaint'] = this.chiefComplaint;
data['Hopi'] = this.hopi;
data['CurrentMedication'] = this.currentMedication;
data['ispregnant'] = this.ispregnant;
data['isLactation'] = this.isLactation;
data['numberOfWeeks'] = this.numberOfWeeks;
return data;
}
}

@ -0,0 +1,64 @@
class PostHistoriesRequestModel {
List<ListMedicalHistoryVM> listMedicalHistoryVM;
PostHistoriesRequestModel({this.listMedicalHistoryVM});
PostHistoriesRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listMedicalHistoryVM'] != null) {
listMedicalHistoryVM = new List<ListMedicalHistoryVM>();
json['listMedicalHistoryVM'].forEach((v) {
listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listMedicalHistoryVM != null) {
data['listMedicalHistoryVM'] =
this.listMedicalHistoryVM.map((v) => v.toJson()).toList();
}
return data;
}
}
class ListMedicalHistoryVM {
int patientMRN;
int historyType;
int historyId;
int episodeId;
int appointmentNo;
bool isChecked;
String remarks;
ListMedicalHistoryVM(
{this.patientMRN,
this.historyType,
this.historyId,
this.episodeId,
this.appointmentNo,
this.isChecked,
this.remarks});
ListMedicalHistoryVM.fromJson(Map<String, dynamic> json) {
patientMRN = json['patientMRN'];
historyType = json['historyType'];
historyId = json['historyId'];
episodeId = json['episodeId'];
appointmentNo = json['appointmentNo'];
isChecked = json['isChecked'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['patientMRN'] = this.patientMRN;
data['historyType'] = this.historyType;
data['historyId'] = this.historyId;
data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo;
data['isChecked'] = this.isChecked;
data['remarks'] = this.remarks;
return data;
}
}

@ -300,6 +300,7 @@ class TranslationBase {
String get next => localizedValues['next'][locale.languageCode];
String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode];
String get emptyMessage => localizedValues['empty-message'][locale.languageCode];
String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode];
}

@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart';
@ -34,9 +36,9 @@ class _SubjectivePageState extends State<SubjectivePage> {
bool isChiefExpand = false;
bool isHistoryExpand = false;
bool isAllergiesExpand = false;
List<MasterKeyModel> myHistoryList = List();
TextEditingController illnessController = TextEditingController();
TextEditingController complaintsController = TextEditingController();
final formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
@ -83,56 +85,64 @@ class _SubjectivePageState extends State<SubjectivePage> {
isChiefExpand ? EvaIcons.minus : EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Chief Complaints",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: complaintsController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "History of Present Illness",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: illnessController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
AddMedication(),
]),
bodyWidget: Form(
key: formKey,
child: Column(children: [
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Chief Complaints",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: complaintsController,
validator: (value) {
if (value == null || value =="")
return TranslationBase
.of(context)
.emptyMessage;
else if (value.length < 25)
return TranslationBase
.of(context)
.chiefComplaintLength;
//"";
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "History of Present Illness",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: illnessController,
validator: (value) {
if (value == null || value =="")
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
AddMedication(),
]),
),
isExpand: isChiefExpand,
),
@ -177,7 +187,7 @@ class _SubjectivePageState extends State<SubjectivePage> {
),
bodyWidget: Column(
children: [
AddHistoryWidget(myHistoryList: myHistoryList)
AddHistoryWidget(myHistoryList: widget.myHistoryList)
],
),
isExpand: isHistoryExpand,
@ -243,58 +253,118 @@ class _SubjectivePageState extends State<SubjectivePage> {
SizedBox(
height: 30,
),
AppButton(
title: TranslationBase
.of(context)
.next,
onPressed: () async {
addSubjectiveInfo(model: model,
myAllergiesList: widget.myAllergiesList,
myHistoryList: myHistoryList);
},
),
AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
addSubjectiveInfo(
model: model,
myAllergiesList: widget.myAllergiesList,
myHistoryList: widget.myHistoryList);
},
),
],
),
),
),
),),);
),
),
);
}
addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<
MasterKeyModel> myHistoryList }) async {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
{SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MasterKeyModel> myHistoryList}) async {
await postChiefComplaint(model: model);
if (myHistoryList.length != 0)
await postHistories(model: model, myHistoryList: myHistoryList);
if (myAllergiesList.length != 0)
await postAllergy(myAllergiesList: myAllergiesList, model: model);
widget.changePageViewIndex(1);
}
postAllergy(
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
widget.myAllergiesList.forEach((allergy) {
if(postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==null)
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: 2500477,
episodeId: 200011502,
appointmentNo: 2016053271,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: 1485,
createdOn: "2020-08-14T20:37:22.780Z",
editedBy: 1485,
editedOn: "2020-08-14T20:37:22.780Z",
isChecked: false,
isUpdatedByNurse: false
));
//TODO: make static value dynamic
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM
.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: 3120690,
episodeId: 200012117,
appointmentNo: 2016054573,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: 1485,
//
createdOn: "2020-08-14T20:37:22.780Z",
editedBy: 1485,
editedOn: "2020-08-14T20:37:22.780Z",
isChecked: false,
isUpdatedByNurse: false));
});
await model.postAllergy(postAllergyRequestModel);
if(model.state == ViewState.ErrorLocal) {
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}
widget.changePageViewIndex(1);
}
print(postAllergyRequestModel);
postHistories(
{List<MasterKeyModel> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel();
widget.myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
//TODO: make static value dynamic
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: 3120690,
episodeId: 200012117,
appointmentNo: 2016054573,
remarks: "",
historyId: history.id,
historyType: history.typeId,
isChecked: false,
));
});
await model.postHistories(postHistoriesRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}
}
postChiefComplaint({SOAPViewModel model}) async {
formKey.currentState.save();
if(formKey.currentState.validate()){
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
//TODO: make static value dynamic
new PostChiefComplaintRequestModel(
patientMRN: 3120690,
episodeID: 200012117,
appointmentNo: 2016054573,
chiefComplaint: complaintsController.text,
currentMedication: "currentMedication",
hopi: illnessController.text,
isLactation: false,
ispregnant: false,
numberOfWeeks: 22);
await model.postChiefComplaint(postChiefComplaintRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}
}
}
}

@ -157,7 +157,7 @@ class _TextFieldsState extends State<TextFields> {
:
Icon(EvaIcons.search, size: 20.0, color: Colors.grey[500]),
errorStyle: TextStyle(fontSize: 14.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null),
errorStyle: TextStyle(fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5 ), width: 2.0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)

@ -14,50 +14,78 @@ class AppButton extends StatefulWidget {
final Color color;
final double fontSize;
final double padding;
final bool loading;
final bool disabled;
AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2, this.padding = 13});
AppButton(
{@required this.onPressed,
this.title,
this.icon,
this.color,
this.fontSize = 2,
this.padding = 13,
this.loading = false,
this.disabled = false});
_AppButtonState createState() => _AppButtonState();
}
class _AppButtonState extends State<AppButton>{
@override
Widget build(BuildContext context) {
return
RawMaterialButton(
fillColor: widget.color != null ? widget.color : HexColor("#B8382C"),
splashColor: widget.color,
child: Padding(
padding: EdgeInsets.only(
top: widget.padding,
bottom: widget.padding,
//right: SizeConfig.widthMultiplier * widget.padding,
//left: SizeConfig.widthMultiplier * widget.padding
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
if (widget.icon != null)
Icon(
widget.icon,
color: Colors.white,
),
if (widget.icon != null)
SizedBox(
width: 5.0,
),
AppText(
widget.title.toUpperCase(),
color: Colors.white,
fontSize: SizeConfig.textMultiplier * widget.fontSize ,
),
],
return
IgnorePointer(
ignoring: widget.loading,
child: RawMaterialButton(
fillColor: widget.color != null ? widget.color : HexColor("#B8382C"),
splashColor: widget.color,
child: Padding(
padding: EdgeInsets.only(
top: widget.padding,
bottom: widget.padding,
//right: SizeConfig.widthMultiplier * widget.padding,
//left: SizeConfig.widthMultiplier * widget.padding
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
if (widget.icon != null)
Icon(
widget.icon,
color: Colors.white,
),
if (widget.icon != null)
SizedBox(
width: 5.0,
),
widget.loading
? Padding(
padding: EdgeInsets.all(2.6),
child: SizedBox(
height: 19.0,
width: 19.0,
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor:
AlwaysStoppedAnimation<Color>(
Colors.grey[300],
),
),
),
)
: AppText(
widget.title.toUpperCase(),
color: Colors.white,
fontSize: SizeConfig.textMultiplier * widget.fontSize,
),
],
),
),
onPressed: widget.onPressed,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(6))),
),
onPressed: widget.onPressed,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(6))),
);
);
}
}
Loading…
Cancel
Save