Merge branch 'mohammad' into 'master'

Mohammad

See merge request Cloud_Solution/doctor_app_flutter!29
merge-requests/30/merge
Mohammad Aljammal 6 years ago
commit 7196c92b12

@ -1,4 +1,4 @@
class ScheduleRequest { class RequestSchedule {
int projectID; int projectID;
int clinicID; int clinicID;
int doctorID; int doctorID;
@ -14,7 +14,7 @@ class ScheduleRequest {
bool patientOutSA; bool patientOutSA;
int patientTypeID; int patientTypeID;
ScheduleRequest( RequestSchedule(
this.projectID, this.projectID,
this.clinicID, this.clinicID,
this.doctorID, this.doctorID,
@ -30,7 +30,7 @@ class ScheduleRequest {
this.patientOutSA, this.patientOutSA,
this.patientTypeID); this.patientTypeID);
ScheduleRequest.fromJson(Map<String, dynamic> json) { RequestSchedule.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID']; projectID = json['ProjectID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];

@ -8,7 +8,7 @@ import 'package:http_interceptor/http_client_with_interceptor.dart';
import '../interceptor/http_interceptor.dart'; import '../interceptor/http_interceptor.dart';
import '../models/list_doctor_working_hours_table_model.dart'; import '../models/list_doctor_working_hours_table_model.dart';
import '../models/ScheduleRequest.dart'; import '../models/RequestSchedule.dart';
class ScheduleProvider with ChangeNotifier { class ScheduleProvider with ChangeNotifier {
Client client = Client client =
@ -18,7 +18,7 @@ class ScheduleProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
ScheduleRequest scheduleRequest = ScheduleRequest( RequestSchedule requestSchedule = RequestSchedule(
15, 15,
1, 1,
70907, 70907,
@ -42,7 +42,7 @@ class ScheduleProvider with ChangeNotifier {
const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable'; const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable';
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(url, body: json.encode(scheduleRequest.toJson())); final response = await client.post(url, body: json.encode(requestSchedule.toJson()));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
isLoading = false; isLoading = false;

@ -14,7 +14,7 @@ class MyScheduleScreen extends StatelessWidget {
scheduleProvider = Provider.of(context); scheduleProvider = Provider.of(context);
return AppScaffold( return AppScaffold(
// pageOnly: false, // pageOnly: false,
appBarTitle: 'My Schdule', appBarTitle: 'My Schedule',
body: scheduleProvider.isLoading body: scheduleProvider.isLoading
? Center( ? Center(
child: CircularProgressIndicator(), child: CircularProgressIndicator(),
@ -48,7 +48,7 @@ class MyScheduleScreen extends StatelessWidget {
), ),
Text('My Schedule', Text('My Schedule',
style: textStyle(2.5, FontWeight.w700)), style: textStyle(2.5, FontWeight.w700)),
scheduleListByDate('Today, 7 April '), scheduleListByDate(),
// scheduleListByDate('Wednesday, 8 April '), // scheduleListByDate('Wednesday, 8 April '),
], ],
), ),
@ -60,14 +60,13 @@ class MyScheduleScreen extends StatelessWidget {
); );
} }
Column scheduleListByDate(date) { Column scheduleListByDate() {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 10, height: 10,
), ),
// Text(date, style: textStyle(2.5)),
Container( Container(
child: Column( child: Column(
children: scheduleProvider.listDoctorWorkingHoursTable.map((item) { children: scheduleProvider.listDoctorWorkingHoursTable.map((item) {

@ -73,6 +73,13 @@ class Helpers {
toastMsg.showErrorToast(localMsg); toastMsg.showErrorToast(localMsg);
} }
/*
*@author: Mohammad Aljammal
*@Date:27/4/2020
*@param:
*@return: Boolean
*@desc: Check The Internet Connection
*/
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult =
await (Connectivity().checkConnectivity()); await (Connectivity().checkConnectivity());

@ -3,6 +3,14 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
/*
*@author: Mohammad Aljammal
*@Date:27/4/2020
*@param: line1Text, line2Text, heightPercentage, widthPercentage
*@return:
*@desc: Card Dr Schedule
*/
class CardWithBgWidget extends StatelessWidget { class CardWithBgWidget extends StatelessWidget {
String line1Text; String line1Text;
String line2Text; String line2Text;
@ -57,7 +65,6 @@ class CardWithBgWidget extends StatelessWidget {
), ),
), ),
elevation: 0, elevation: 0,
// raduis: 0,
showBorder: true, showBorder: true,
borderColor: Hexcolor('#707070'), borderColor: Hexcolor('#707070'),
customCornerRaduis: true, customCornerRaduis: true,

Loading…
Cancel
Save