Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into Haroon
# Conflicts: # lib/pages/login/login.dartmerge-update-with-lab-changes
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 212 KiB |
@ -0,0 +1,64 @@
|
|||||||
|
class AppointmentDetails {
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
int patientID;
|
||||||
|
int appointmentNo;
|
||||||
|
int clinicID;
|
||||||
|
int doctorID;
|
||||||
|
String startTime;
|
||||||
|
String endTime;
|
||||||
|
String appointmentDate;
|
||||||
|
String clinicName;
|
||||||
|
String doctorImageURL;
|
||||||
|
String doctorName;
|
||||||
|
String projectName;
|
||||||
|
|
||||||
|
AppointmentDetails(
|
||||||
|
{this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.patientID,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.clinicID,
|
||||||
|
this.doctorID,
|
||||||
|
this.startTime,
|
||||||
|
this.endTime,
|
||||||
|
this.appointmentDate,
|
||||||
|
this.clinicName,
|
||||||
|
this.doctorImageURL,
|
||||||
|
this.doctorName,
|
||||||
|
this.projectName});
|
||||||
|
|
||||||
|
AppointmentDetails.fromJson(Map<String, dynamic> json) {
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
startTime = json['StartTime'];
|
||||||
|
endTime = json['EndTime'];
|
||||||
|
appointmentDate = json['AppointmentDate'];
|
||||||
|
clinicName = json['ClinicName'];
|
||||||
|
doctorImageURL = json['DoctorImageURL'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
projectName = json['ProjectName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['StartTime'] = this.startTime;
|
||||||
|
data['EndTime'] = this.endTime;
|
||||||
|
data['AppointmentDate'] = this.appointmentDate;
|
||||||
|
data['ClinicName'] = this.clinicName;
|
||||||
|
data['DoctorImageURL'] = this.doctorImageURL;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['ProjectName'] = this.projectName;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
class AppointmentRate {
|
||||||
|
int rate;
|
||||||
|
int appointmentNo;
|
||||||
|
int projectID;
|
||||||
|
int doctorID;
|
||||||
|
int clinicID;
|
||||||
|
String note;
|
||||||
|
String mobileNumber;
|
||||||
|
int createdBy;
|
||||||
|
int editedBy;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int patientOutSA;
|
||||||
|
String sessionID;
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
int deviceTypeID;
|
||||||
|
int patientID;
|
||||||
|
String tokenID;
|
||||||
|
int patientTypeID;
|
||||||
|
int patientType;
|
||||||
|
|
||||||
|
AppointmentRate(
|
||||||
|
{this.rate,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.projectID,
|
||||||
|
this.doctorID,
|
||||||
|
this.clinicID,
|
||||||
|
this.note,
|
||||||
|
this.mobileNumber,
|
||||||
|
this.createdBy,
|
||||||
|
this.editedBy,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.sessionID,
|
||||||
|
this.isDentalAllowedBackend,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.patientID,
|
||||||
|
this.tokenID,
|
||||||
|
this.patientTypeID,
|
||||||
|
this.patientType});
|
||||||
|
|
||||||
|
AppointmentRate.fromJson(Map<String, dynamic> json) {
|
||||||
|
rate = json['Rate'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
note = json['Note'];
|
||||||
|
mobileNumber = json['MobileNumber'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
patientTypeID = json['PatientTypeID'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Rate'] = this.rate;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['Note'] = this.note;
|
||||||
|
data['MobileNumber'] = this.mobileNumber;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['PatientTypeID'] = this.patientTypeID;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,160 @@
|
|||||||
|
class AppoitmentRated {
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
int appointmentNo;
|
||||||
|
String appointmentDate;
|
||||||
|
String appointmentDateN;
|
||||||
|
int appointmentType;
|
||||||
|
String bookDate;
|
||||||
|
int patientType;
|
||||||
|
int patientID;
|
||||||
|
int clinicID;
|
||||||
|
int doctorID;
|
||||||
|
String endDate;
|
||||||
|
String startTime;
|
||||||
|
String endTime;
|
||||||
|
int status;
|
||||||
|
int visitType;
|
||||||
|
int visitFor;
|
||||||
|
int patientStatusType;
|
||||||
|
int companyID;
|
||||||
|
int bookedBy;
|
||||||
|
String bookedOn;
|
||||||
|
int confirmedBy;
|
||||||
|
String confirmedOn;
|
||||||
|
int arrivalChangedBy;
|
||||||
|
String arrivedOn;
|
||||||
|
int editedBy;
|
||||||
|
String editedOn;
|
||||||
|
Null doctorName;
|
||||||
|
String doctorNameN;
|
||||||
|
String statusDesc;
|
||||||
|
String statusDescN;
|
||||||
|
bool vitalStatus;
|
||||||
|
Null vitalSignAppointmentNo;
|
||||||
|
int episodeID;
|
||||||
|
String doctorTitle;
|
||||||
|
bool isAppoitmentLiveCare;
|
||||||
|
|
||||||
|
AppoitmentRated(
|
||||||
|
{this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.appointmentDate,
|
||||||
|
this.appointmentDateN,
|
||||||
|
this.appointmentType,
|
||||||
|
this.bookDate,
|
||||||
|
this.patientType,
|
||||||
|
this.patientID,
|
||||||
|
this.clinicID,
|
||||||
|
this.doctorID,
|
||||||
|
this.endDate,
|
||||||
|
this.startTime,
|
||||||
|
this.endTime,
|
||||||
|
this.status,
|
||||||
|
this.visitType,
|
||||||
|
this.visitFor,
|
||||||
|
this.patientStatusType,
|
||||||
|
this.companyID,
|
||||||
|
this.bookedBy,
|
||||||
|
this.bookedOn,
|
||||||
|
this.confirmedBy,
|
||||||
|
this.confirmedOn,
|
||||||
|
this.arrivalChangedBy,
|
||||||
|
this.arrivedOn,
|
||||||
|
this.editedBy,
|
||||||
|
this.editedOn,
|
||||||
|
this.doctorName,
|
||||||
|
this.doctorNameN,
|
||||||
|
this.statusDesc,
|
||||||
|
this.statusDescN,
|
||||||
|
this.vitalStatus,
|
||||||
|
this.vitalSignAppointmentNo,
|
||||||
|
this.episodeID,
|
||||||
|
this.doctorTitle,
|
||||||
|
this.isAppoitmentLiveCare});
|
||||||
|
|
||||||
|
AppoitmentRated.fromJson(Map<String, dynamic> json) {
|
||||||
|
try {
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
appointmentDate = json['AppointmentDate'];
|
||||||
|
appointmentDateN = json['AppointmentDateN'];
|
||||||
|
appointmentType = json['AppointmentType'];
|
||||||
|
bookDate = json['BookDate'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
endDate = json['EndDate'];
|
||||||
|
startTime = json['StartTime'];
|
||||||
|
endTime = json['EndTime'];
|
||||||
|
status = json['Status'];
|
||||||
|
visitType = json['VisitType'];
|
||||||
|
visitFor = json['VisitFor'];
|
||||||
|
patientStatusType = json['PatientStatusType'];
|
||||||
|
companyID = json['CompanyID'];
|
||||||
|
bookedBy = json['BookedBy'];
|
||||||
|
bookedOn = json['BookedOn'];
|
||||||
|
confirmedBy = json['ConfirmedBy'];
|
||||||
|
confirmedOn = json['ConfirmedOn'];
|
||||||
|
arrivalChangedBy = json['ArrivalChangedBy'];
|
||||||
|
arrivedOn = json['ArrivedOn'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
editedOn = json['EditedOn'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
doctorNameN = json['DoctorNameN'];
|
||||||
|
statusDesc = json['StatusDesc'];
|
||||||
|
statusDescN = json['StatusDescN'];
|
||||||
|
vitalStatus = json['VitalStatus'];
|
||||||
|
vitalSignAppointmentNo = json['VitalSignAppointmentNo'];
|
||||||
|
episodeID = json['EpisodeID'];
|
||||||
|
doctorTitle = json['DoctorTitle'];
|
||||||
|
isAppoitmentLiveCare = json['IsAppoitmentLiveCare'];
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['AppointmentDate'] = this.appointmentDate;
|
||||||
|
data['AppointmentDateN'] = this.appointmentDateN;
|
||||||
|
data['AppointmentType'] = this.appointmentType;
|
||||||
|
data['BookDate'] = this.bookDate;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['EndDate'] = this.endDate;
|
||||||
|
data['StartTime'] = this.startTime;
|
||||||
|
data['EndTime'] = this.endTime;
|
||||||
|
data['Status'] = this.status;
|
||||||
|
data['VisitType'] = this.visitType;
|
||||||
|
data['VisitFor'] = this.visitFor;
|
||||||
|
data['PatientStatusType'] = this.patientStatusType;
|
||||||
|
data['CompanyID'] = this.companyID;
|
||||||
|
data['BookedBy'] = this.bookedBy;
|
||||||
|
data['BookedOn'] = this.bookedOn;
|
||||||
|
data['ConfirmedBy'] = this.confirmedBy;
|
||||||
|
data['ConfirmedOn'] = this.confirmedOn;
|
||||||
|
data['ArrivalChangedBy'] = this.arrivalChangedBy;
|
||||||
|
data['ArrivedOn'] = this.arrivedOn;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['EditedOn'] = this.editedOn;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['DoctorNameN'] = this.doctorNameN;
|
||||||
|
data['StatusDesc'] = this.statusDesc;
|
||||||
|
data['StatusDescN'] = this.statusDescN;
|
||||||
|
data['VitalStatus'] = this.vitalStatus;
|
||||||
|
data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo;
|
||||||
|
data['EpisodeID'] = this.episodeID;
|
||||||
|
data['DoctorTitle'] = this.doctorTitle;
|
||||||
|
data['IsAppoitmentLiveCare'] = this.isAppoitmentLiveCare;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appointment_rate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
|
||||||
|
class AppointmentRateService extends BaseService {
|
||||||
|
List<AppoitmentRated> appointmentRatedList = List();
|
||||||
|
AppointmentDetails appointmentDetails;
|
||||||
|
|
||||||
|
Future getIsLastAppointmentRatedList() async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(IS_LAST_APPOITMENT_RATED,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
appointmentRatedList.clear();
|
||||||
|
response['IsLastAppoitmentRatedList'].forEach((appoint) {
|
||||||
|
appointmentRatedList.add(AppoitmentRated.fromJson(appoint));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: Map());
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getAppointmentDetails() async {
|
||||||
|
hasError = false;
|
||||||
|
Map<String, dynamic> bodyData = Map();
|
||||||
|
bodyData['AppointmentNumber'] = appointmentRatedList[0].appointmentNo;
|
||||||
|
bodyData['ProjectID'] = appointmentRatedList[0].projectID;
|
||||||
|
await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
if (response['AppointmentDetails'] != null)
|
||||||
|
appointmentDetails =
|
||||||
|
AppointmentDetails.fromJson(response['AppointmentDetails']);
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: bodyData);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future sendAppointmentRate(int rate, int appointmentNo, int projectID,
|
||||||
|
int doctorID, int clinicID, String note) async {
|
||||||
|
hasError = false;
|
||||||
|
AppointmentRate appointmentRate = AppointmentRate();
|
||||||
|
appointmentRate.rate = rate;
|
||||||
|
appointmentRate.appointmentNo = appointmentNo;
|
||||||
|
appointmentRate.projectID = projectID;
|
||||||
|
appointmentRate.doctorID = doctorID;
|
||||||
|
appointmentRate.clinicID = clinicID;
|
||||||
|
appointmentRate.note = note;
|
||||||
|
|
||||||
|
await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: appointmentRate.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
AppoitmentRated get lastAppointmentRated {
|
||||||
|
if (appointmentRatedList.length > 0)
|
||||||
|
return appointmentRatedList[appointmentRatedList.length - 1];
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteAppointmentRated(AppoitmentRated appointmentRated) {
|
||||||
|
appointmentRatedList.remove(appointmentRated);
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteAllAppAppointmentRate() => appointmentRatedList.clear();
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
|
||||||
|
class DashboardService extends BaseService {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/appointment_rate_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import '../../locator.dart';
|
||||||
|
|
||||||
|
class AppointmentRateViewModel extends BaseViewModel {
|
||||||
|
AppointmentRateService _appointmentRateService =
|
||||||
|
locator<AppointmentRateService>();
|
||||||
|
bool isHaveAppointmentNotRate = false;
|
||||||
|
|
||||||
|
AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails;
|
||||||
|
|
||||||
|
|
||||||
|
Future getIsLastAppointmentRatedList() async {
|
||||||
|
isHaveAppointmentNotRate = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _appointmentRateService.getIsLastAppointmentRatedList();
|
||||||
|
if (_appointmentRateService.hasError) {
|
||||||
|
error = _appointmentRateService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
if(_appointmentRateService.appointmentRatedList.length>0)
|
||||||
|
await getAppointmentDetails();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getAppointmentDetails() async {
|
||||||
|
await _appointmentRateService.getAppointmentDetails();
|
||||||
|
if (_appointmentRateService.hasError) {
|
||||||
|
error = _appointmentRateService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
if (_appointmentRateService.appointmentDetails != null)
|
||||||
|
isHaveAppointmentNotRate = true;
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future sendAppointmentRate(int rate, int appointmentNo, int projectID,
|
||||||
|
int doctorID, int clinicID, String note) async {
|
||||||
|
setState(ViewState.BusyLocal);
|
||||||
|
await _appointmentRateService.sendAppointmentRate(
|
||||||
|
rate, appointmentNo, projectID, doctorID, clinicID, note);
|
||||||
|
if (_appointmentRateService.hasError) {
|
||||||
|
error = _appointmentRateService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
_appointmentRateService.deleteAllAppAppointmentRate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AppoitmentRated get lastAppointmentRated =>
|
||||||
|
_appointmentRateService.lastAppointmentRated;
|
||||||
|
|
||||||
|
deleteAppointmentRated(AppoitmentRated appointmentRated) =>
|
||||||
|
_appointmentRateService.deleteAppointmentRated(appointmentRated);
|
||||||
|
|
||||||
|
deleteAppAppointmentRate() =>
|
||||||
|
_appointmentRateService.deleteAllAppAppointmentRate();
|
||||||
|
|
||||||
|
setIsRated(bool isRated) {
|
||||||
|
this.isHaveAppointmentNotRate = isRated;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/dashboard_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import '../../locator.dart';
|
||||||
|
|
||||||
|
class DashboardViewModel extends BaseViewModel {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,173 @@
|
|||||||
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'DoctorView.dart';
|
||||||
|
|
||||||
|
class BranchView extends StatefulWidget {
|
||||||
|
final List<DoctorList> doctorsList;
|
||||||
|
|
||||||
|
final List<String> result;
|
||||||
|
final int num;
|
||||||
|
|
||||||
|
const BranchView({Key key, this.doctorsList, this.result, this.num})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_BranchViewState createState() => _BranchViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BranchViewState extends State<BranchView> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: TranslationBase.of(context).bookAppo,
|
||||||
|
isShowAppBar: true,
|
||||||
|
body: new ListView.builder(
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return new ExpandableListView(
|
||||||
|
|
||||||
|
result2: widget.result,
|
||||||
|
val: index,
|
||||||
|
doctorsList2: widget.doctorsList);
|
||||||
|
},
|
||||||
|
itemCount: widget.num, //5,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ExpandableListView extends StatefulWidget {
|
||||||
|
|
||||||
|
final List<String> result2;
|
||||||
|
final List<DoctorList> doctorsList2;
|
||||||
|
final val;
|
||||||
|
|
||||||
|
const ExpandableListView(
|
||||||
|
{Key key, this.result2, this.val, this.doctorsList2})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ExpandableListViewState createState() => new _ExpandableListViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ExpandableListViewState extends State<ExpandableListView> {
|
||||||
|
bool expandFlag = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return new Container(
|
||||||
|
// margin: new EdgeInsets.symmetric(vertical: 1.0),
|
||||||
|
width: MediaQuery.of(context).size.width * 0.6,
|
||||||
|
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
|
||||||
|
child: Card(
|
||||||
|
// margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
padding: EdgeInsets.all(5.0),
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: new Column(
|
||||||
|
children: <Widget>[
|
||||||
|
new Container(
|
||||||
|
color: Colors.white,
|
||||||
|
// padding: new EdgeInsets.symmetric(horizontal: 5.0),
|
||||||
|
child: new Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
new Text(
|
||||||
|
widget.result2[widget.val].toString()+" "+ "22 كم",
|
||||||
|
style: new TextStyle(
|
||||||
|
fontWeight: FontWeight.bold, color: Colors.black),
|
||||||
|
),
|
||||||
|
new IconButton(
|
||||||
|
icon: new Container(
|
||||||
|
height: 30.0,
|
||||||
|
width: 30.0,
|
||||||
|
decoration: new BoxDecoration(
|
||||||
|
color: Colors.red,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: new Center(
|
||||||
|
child: new Icon(
|
||||||
|
expandFlag
|
||||||
|
? Icons.keyboard_arrow_up
|
||||||
|
: Icons.keyboard_arrow_down,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 30.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
expandFlag = !expandFlag;
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// SizedBox(height: 15),
|
||||||
|
new ExpandableContainer(
|
||||||
|
expanded: expandFlag,
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: ScrollPhysics(),
|
||||||
|
padding: EdgeInsets.all(0.0),
|
||||||
|
itemCount: widget.doctorsList2.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return widget.result2[widget.val].toString() ==
|
||||||
|
widget.doctorsList2[index].projectName.toString()? DoctorView(
|
||||||
|
//AJ note
|
||||||
|
doctor:
|
||||||
|
widget.doctorsList2[index]
|
||||||
|
|
||||||
|
// widget.doctorsList2[index]
|
||||||
|
):Container();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ExpandableContainer extends StatelessWidget {
|
||||||
|
final bool expanded;
|
||||||
|
final double collapsedHeight;
|
||||||
|
final double expandedHeight;
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
ExpandableContainer({
|
||||||
|
@required this.child,
|
||||||
|
this.collapsedHeight = 0.0,
|
||||||
|
this.expandedHeight = 300.0,
|
||||||
|
this.expanded = true,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
double screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
return new AnimatedContainer(
|
||||||
|
duration: new Duration(milliseconds: 500),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
width: screenWidth,
|
||||||
|
height: expanded ? expandedHeight : collapsedHeight,
|
||||||
|
child: new Container(
|
||||||
|
child: child,
|
||||||
|
decoration: new BoxDecoration(
|
||||||
|
border: new Border.all(width: 1.0, color: Colors.white)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,240 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
|
||||||
|
class RateAppointmentClinic extends StatefulWidget {
|
||||||
|
final AppointmentDetails appointmentDetails;
|
||||||
|
final String doctorNote;
|
||||||
|
final int doctorRate;
|
||||||
|
|
||||||
|
RateAppointmentClinic(
|
||||||
|
{this.appointmentDetails, this.doctorRate, this.doctorNote});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_RateAppointmentClinicState createState() => _RateAppointmentClinicState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
|
String note = "";
|
||||||
|
int rating = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<AppointmentRateViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Scaffold(
|
||||||
|
backgroundColor: Colors.grey[200],
|
||||||
|
appBar: AppBar(
|
||||||
|
elevation: 0,
|
||||||
|
textTheme: TextTheme(
|
||||||
|
headline6:
|
||||||
|
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
title: Text('Rate'),
|
||||||
|
leading: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return IconButton(
|
||||||
|
icon: Icon(Icons.menu),
|
||||||
|
color: Colors.white,
|
||||||
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
drawer: SafeArea(child: AppDrawer()),
|
||||||
|
body: FractionallySizedBox(
|
||||||
|
widthFactor: 1,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
'How would you rate your last visit to the Clinic',
|
||||||
|
bold: true,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(color: Colors.white, width: 0.5),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
LargeAvatar(
|
||||||
|
name: model.appointmentDetails.clinicName,
|
||||||
|
width: 110,
|
||||||
|
height: 110,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 22,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
model.appointmentDetails.projectName,
|
||||||
|
bold: true,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
model.appointmentDetails.clinicName,
|
||||||
|
bold: true,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Texts(
|
||||||
|
'Please rate the Clinic',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
...List.generate(
|
||||||
|
5,
|
||||||
|
(index) => AnimatedSwitcher(
|
||||||
|
duration: Duration(milliseconds: 1000),
|
||||||
|
switchInCurve: Curves.elasticOut,
|
||||||
|
switchOutCurve: Curves.elasticIn,
|
||||||
|
transitionBuilder:
|
||||||
|
(Widget child, Animation<double> animation) {
|
||||||
|
return ScaleTransition(
|
||||||
|
child: child, scale: animation);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
key: ValueKey<int>(rating),
|
||||||
|
child: IconButton(
|
||||||
|
iconSize: 55.0,
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
rating = index + 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
color: rating >= (index + 1)
|
||||||
|
? Color.fromRGBO(255, 186, 0, 1.0)
|
||||||
|
: Colors.grey[400],
|
||||||
|
// Theme.of(context).hintColor,
|
||||||
|
icon: Icon(rating >= (index + 1)
|
||||||
|
? EvaIcons.star
|
||||||
|
: EvaIcons.star)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.15,
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.grey[200],
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: SecondaryButton(
|
||||||
|
onTap: () async {
|
||||||
|
if (rating > 0) {
|
||||||
|
model
|
||||||
|
.sendAppointmentRate(
|
||||||
|
rating,
|
||||||
|
widget.appointmentDetails.appointmentNo,
|
||||||
|
widget.appointmentDetails.projectID,
|
||||||
|
widget.appointmentDetails.doctorID,
|
||||||
|
widget.appointmentDetails.clinicID,
|
||||||
|
note)
|
||||||
|
.then(
|
||||||
|
(value) => {
|
||||||
|
Navigator.pushReplacement(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: LandingPage(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(
|
||||||
|
message: 'please rate the clinic');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label: "Rate",
|
||||||
|
disabled: model.state == ViewState.BusyLocal,
|
||||||
|
loading: model.state == ViewState.BusyLocal,
|
||||||
|
textColor: Theme.of(context).backgroundColor),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pushReplacement(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: LandingPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Texts(
|
||||||
|
'Later',
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
color: Hexcolor('#151DFE'),
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,241 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
|
||||||
|
class RateAppointmentDoctor extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_RateAppointmentDoctorState createState() => _RateAppointmentDoctorState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
|
String note = "";
|
||||||
|
int rating = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<AppointmentRateViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Scaffold(
|
||||||
|
backgroundColor: Colors.grey[200],
|
||||||
|
appBar: AppBar(
|
||||||
|
elevation: 0,
|
||||||
|
textTheme: TextTheme(
|
||||||
|
headline6:
|
||||||
|
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
title: Text('Rate'),
|
||||||
|
leading: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return IconButton(
|
||||||
|
icon: Icon(Icons.menu),
|
||||||
|
color: Colors.white,
|
||||||
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
drawer: SafeArea(child: AppDrawer()),
|
||||||
|
body: FractionallySizedBox(
|
||||||
|
widthFactor: 1,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
'How would you rate your last visit to the doctor',
|
||||||
|
bold: true,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 25,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(color: Colors.white, width: 0.5),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
LargeAvatar(
|
||||||
|
name: model.appointmentDetails.doctorName,
|
||||||
|
url: model.appointmentDetails.doctorImageURL,
|
||||||
|
width: 110,
|
||||||
|
height: 110,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 22,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
model.appointmentDetails.doctorName,
|
||||||
|
bold: true,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
model.appointmentDetails.clinicName,
|
||||||
|
bold: true,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Texts(
|
||||||
|
'Please rate the doctor',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
...List.generate(
|
||||||
|
5,
|
||||||
|
(index) => AnimatedSwitcher(
|
||||||
|
duration: Duration(milliseconds: 1000),
|
||||||
|
switchInCurve: Curves.elasticOut,
|
||||||
|
switchOutCurve: Curves.elasticIn,
|
||||||
|
transitionBuilder:
|
||||||
|
(Widget child, Animation<double> animation) {
|
||||||
|
return ScaleTransition(
|
||||||
|
child: child, scale: animation);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
key: ValueKey<int>(rating),
|
||||||
|
child: IconButton(
|
||||||
|
iconSize: 55.0,
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
rating = index + 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
color: rating >= (index + 1)
|
||||||
|
? Color.fromRGBO(255, 186, 0, 1.0)
|
||||||
|
: Colors.grey[400],
|
||||||
|
// Theme.of(context).hintColor,
|
||||||
|
icon: Icon(rating >= (index + 1)
|
||||||
|
? EvaIcons.star
|
||||||
|
: EvaIcons.star)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Form(
|
||||||
|
key: formKey,
|
||||||
|
child: TextFields(
|
||||||
|
hintText: "Notes",
|
||||||
|
minLines: 4,
|
||||||
|
maxLines: 4,
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty)
|
||||||
|
return 'Please enter your note';
|
||||||
|
else if (rating == 0) return 'Rating cannot be \"0\"';
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
note = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12,),
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: SecondaryButton(
|
||||||
|
onTap: () async {
|
||||||
|
final form = formKey.currentState;
|
||||||
|
if (form.validate()) {
|
||||||
|
form.save();
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: RateAppointmentClinic(
|
||||||
|
appointmentDetails:
|
||||||
|
model.appointmentDetails,
|
||||||
|
doctorNote: note,
|
||||||
|
doctorRate: rating,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label: "Next",
|
||||||
|
disabled: model.state == ViewState.BusyLocal,
|
||||||
|
loading: model.state == ViewState.BusyLocal,
|
||||||
|
textColor: Theme.of(context).backgroundColor),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pushReplacement(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: LandingPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Texts(
|
||||||
|
'Later',
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
color: Hexcolor('#151DFE'),
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||