From 9d2367d86780cdc2b939c5c2712f89f3e4279d1e Mon Sep 17 00:00:00 2001 From: her_username Date: Mon, 27 Apr 2020 02:01:36 +0300 Subject: [PATCH 1/2] change class name --- lib/models/{ScheduleRequest.dart => RequestSchedule.dart} | 6 +++--- lib/providers/schedule_provider.dart | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) rename lib/models/{ScheduleRequest.dart => RequestSchedule.dart} (95%) diff --git a/lib/models/ScheduleRequest.dart b/lib/models/RequestSchedule.dart similarity index 95% rename from lib/models/ScheduleRequest.dart rename to lib/models/RequestSchedule.dart index 7114948a..cddfe0f8 100644 --- a/lib/models/ScheduleRequest.dart +++ b/lib/models/RequestSchedule.dart @@ -1,4 +1,4 @@ -class ScheduleRequest { +class RequestSchedule { int projectID; int clinicID; int doctorID; @@ -14,7 +14,7 @@ class ScheduleRequest { bool patientOutSA; int patientTypeID; - ScheduleRequest( + RequestSchedule( this.projectID, this.clinicID, this.doctorID, @@ -30,7 +30,7 @@ class ScheduleRequest { this.patientOutSA, this.patientTypeID); - ScheduleRequest.fromJson(Map json) { + RequestSchedule.fromJson(Map json) { projectID = json['ProjectID']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; diff --git a/lib/providers/schedule_provider.dart b/lib/providers/schedule_provider.dart index 05056c3c..d9639da6 100644 --- a/lib/providers/schedule_provider.dart +++ b/lib/providers/schedule_provider.dart @@ -8,7 +8,7 @@ import 'package:http_interceptor/http_client_with_interceptor.dart'; import '../interceptor/http_interceptor.dart'; import '../models/list_doctor_working_hours_table_model.dart'; -import '../models/ScheduleRequest.dart'; +import '../models/RequestSchedule.dart'; class ScheduleProvider with ChangeNotifier { Client client = @@ -18,7 +18,7 @@ class ScheduleProvider with ChangeNotifier { bool isLoading = true; bool isError = false; String error = ''; - ScheduleRequest scheduleRequest = ScheduleRequest( + RequestSchedule requestSchedule = RequestSchedule( 15, 1, 70907, @@ -42,7 +42,7 @@ class ScheduleProvider with ChangeNotifier { const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable'; try { 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; if (statusCode < 200 || statusCode >= 400 || json == null) { isLoading = false; From e387820fe1f6e7fc5dfecdbc89d71e5f778643aa Mon Sep 17 00:00:00 2001 From: her_username Date: Mon, 27 Apr 2020 02:15:26 +0300 Subject: [PATCH 2/2] add some comment --- lib/screens/my_schedule_screen.dart | 7 +++---- lib/util/helpers.dart | 7 +++++++ lib/widgets/shared/card_with_bg_widget.dart | 9 ++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/screens/my_schedule_screen.dart b/lib/screens/my_schedule_screen.dart index 2c7dd6f5..0e0eebce 100644 --- a/lib/screens/my_schedule_screen.dart +++ b/lib/screens/my_schedule_screen.dart @@ -14,7 +14,7 @@ class MyScheduleScreen extends StatelessWidget { scheduleProvider = Provider.of(context); return AppScaffold( // pageOnly: false, - appBarTitle: 'My Schdule', + appBarTitle: 'My Schedule', body: scheduleProvider.isLoading ? Center( child: CircularProgressIndicator(), @@ -48,7 +48,7 @@ class MyScheduleScreen extends StatelessWidget { ), Text('My Schedule', style: textStyle(2.5, FontWeight.w700)), - scheduleListByDate('Today, 7 April '), + scheduleListByDate(), // scheduleListByDate('Wednesday, 8 April '), ], ), @@ -60,14 +60,13 @@ class MyScheduleScreen extends StatelessWidget { ); } - Column scheduleListByDate(date) { + Column scheduleListByDate() { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 10, ), - // Text(date, style: textStyle(2.5)), Container( child: Column( children: scheduleProvider.listDoctorWorkingHoursTable.map((item) { diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index a1197e04..a84ec362 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -73,6 +73,13 @@ class Helpers { toastMsg.showErrorToast(localMsg); } +/* + *@author: Mohammad Aljammal + *@Date:27/4/2020 + *@param: + *@return: Boolean + *@desc: Check The Internet Connection + */ static Future checkConnection() async { ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index d9579ff9..e3151732 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -3,6 +3,14 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart' import 'package:flutter/material.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 { String line1Text; String line2Text; @@ -57,7 +65,6 @@ class CardWithBgWidget extends StatelessWidget { ), ), elevation: 0, - // raduis: 0, showBorder: true, borderColor: Hexcolor('#707070'), customCornerRaduis: true,