dashboard sreen updated

merge-requests/341/head
Sultan Khan 5 years ago
parent 05ef7a4b25
commit 3f7961b50c

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/screens/QR_reader_screen.dart';
import 'package:doctor_app_flutter/screens/dashboard_screen.dart'; import 'package:doctor_app_flutter/screens/dashboard_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/message_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/message_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/services_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/services_screen.dart';
@ -64,9 +66,9 @@ class _LandingPageState extends State<LandingPage> {
ShowCaseWidget( ShowCaseWidget(
builder: Builder(builder: (context) => DashboardScreen()), builder: Builder(builder: (context) => DashboardScreen()),
), ),
// MessagesScreen(), DoctorReplyScreen(),
MyScheduleScreen(), MyScheduleScreen(),
// ServicesScreen() QrReaderScreen()
], ],
), ),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
@ -82,7 +84,7 @@ class _LandingPageState extends State<LandingPage> {
case 2: case 2:
return TranslationBase.of(context).mySchedule; return TranslationBase.of(context).mySchedule;
case 3: case 3:
return TranslationBase.of(context).services; return TranslationBase.of(context).qr;
} }
} }
} }

@ -17,6 +17,7 @@ import 'package:flutter/material.dart';
import '../routes.dart'; import '../routes.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
Helpers helpers = Helpers(); Helpers helpers = Helpers();
class QrReaderScreen extends StatefulWidget { class QrReaderScreen extends StatefulWidget {
@ -59,6 +60,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false,
appBarTitle: appBarTitle:
TranslationBase.of(context).qr + TranslationBase.of(context).reader, TranslationBase.of(context).qr + TranslationBase.of(context).reader,
body: Center( body: Center(
@ -104,7 +106,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
color: Theme.of(context).errorColor.withOpacity(0.06), color:
Theme.of(context).errorColor.withOpacity(0.06),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 12.0), vertical: 8.0, horizontal: 12.0),
@ -115,9 +118,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
error ?? error ??
TranslationBase.of(context) TranslationBase.of(context)
.errorMessage, .errorMessage,
color: Theme color: Theme.of(context).errorColor)),
.of(context)
.errorColor)),
], ],
), ),
) )
@ -127,7 +128,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
), ),
), ),
), ),
),); ),
);
} }
_scanQrAndGetPatient(BuildContext context, PatientViewModel model) async { _scanQrAndGetPatient(BuildContext context, PatientViewModel model) async {
@ -154,16 +156,15 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
// Provider.of<PatientsProvider>(context, listen: false); // Provider.of<PatientsProvider>(context, listen: false);
patient.PatientID = 8808; patient.PatientID = 8808;
patient.TokenID = token; patient.TokenID = token;
model model.getPatientList(patient, "1", isBusyLocal: true).then((response) {
.getPatientList(patient, "1", isBusyLocal: true)
.then((response) {
if (response['MessageStatus'] == 1) { if (response['MessageStatus'] == 1) {
switch (patientType) { switch (patientType) {
case "0": case "0":
if (response['List_MyOutPatient'] != null) { if (response['List_MyOutPatient'] != null) {
setState(() { setState(() {
patientList = patientList =
ModelResponse.fromJson(response['List_MyOutPatient']).list; ModelResponse.fromJson(response['List_MyOutPatient'])
.list;
isLoading = false; isLoading = false;
}); });
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {

@ -989,50 +989,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
); );
}, },
), ),
DashboardItem(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
DoctorApp.qr_code,
size: 50,
color: Colors.black,
),
Column(
children: [
AppText(
projectsProvider.isArabic
? TranslationBase.of(context).reader
: TranslationBase.of(context).qr,
color: Colors.black,
textAlign: TextAlign.center,
),
AppText(
projectsProvider.isArabic
? TranslationBase.of(context).qr
: TranslationBase.of(context).reader,
color: Colors.black,
textAlign: TextAlign.center,
),
],
)
],
),
// imageName: '1.png',
hasBorder: true,
onTap: () {
Navigator.of(context).pushNamed(QR_READER);
},
),
],
),
SizedBox(
height: 20,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DashboardItem( DashboardItem(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -1060,44 +1016,88 @@ class _DashboardScreenState extends State<DashboardScreen> {
); );
}, },
), ),
SizedBox( // DashboardItem(
width: 8, // child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: <Widget>[
// Icon(
// DoctorApp.qr_code,
// size: 50,
// color: Colors.black,
// ),
// Column(
// children: [
// AppText(
// projectsProvider.isArabic
// ? TranslationBase.of(context).reader
// : TranslationBase.of(context).qr,
// color: Colors.black,
// textAlign: TextAlign.center,
// ),
// AppText(
// projectsProvider.isArabic
// ? TranslationBase.of(context).qr
// : TranslationBase.of(context).reader,
// color: Colors.black,
// textAlign: TextAlign.center,
// ),
// ],
// )
// ],
// ),
// // imageName: '1.png',
// hasBorder: true,
// onTap: () {
// Navigator.of(context).pushNamed(QR_READER);
// },
// ),
],
), ),
DashboardItem( SizedBox(
child: Column( height: 20,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
DoctorApp.mail,
size: 50,
color: Colors.black,
), ),
Column( Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( SizedBox(
TranslationBase.of(context).theDoctor, width: 8,
textAlign: TextAlign.center,
color: Colors.black,
),
AppText(
TranslationBase.of(context).reply,
textAlign: TextAlign.center,
color: Colors.black,
),
],
)
],
),
hasBorder: true,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DoctorReplyScreen(),
), ),
); // DashboardItem(
}, // child: Column(
) // mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: <Widget>[
// Icon(
// DoctorApp.mail,
// size: 50,
// color: Colors.black,
// ),
// Column(
// children: [
// AppText(
// TranslationBase.of(context).theDoctor,
// textAlign: TextAlign.center,
// color: Colors.black,
// ),
// AppText(
// TranslationBase.of(context).reply,
// textAlign: TextAlign.center,
// color: Colors.black,
// ),
// ],
// )
// ],
// ),
// hasBorder: true,
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => DoctorReplyScreen(),
// ),
// );
// },
// )
], ],
), ),
SizedBox( SizedBox(
@ -1275,7 +1275,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
authProvider.getDocProfiles(docInfo.toJson()).then((res) async { authProvider.getDocProfiles(docInfo.toJson()).then((res) async {
changeIsLoading(false); changeIsLoading(false);
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
model.getDashboard(); // model.getDashboard();
}).catchError((err) { }).catchError((err) {
changeIsLoading(false); changeIsLoading(false);
helpers.showErrorToast(err); helpers.showErrorToast(err);

@ -15,7 +15,6 @@ import 'package:flutter/material.dart';
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
*/ */
class DoctorReplyScreen extends StatelessWidget { class DoctorReplyScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<DoctorReplayViewModel>( return BaseView<DoctorReplayViewModel>(
@ -23,18 +22,19 @@ class DoctorReplyScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2, appBarTitle: TranslationBase.of(context).replay2,
body: model isShowAppBar: false,
.listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem):Container( body: model.listDoctorWorkingHoursTable.isEmpty
? DrAppEmbeddedError(
error: TranslationBase.of(context).noItem)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView( child: ListView(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, children:
children: model model.listDoctorWorkingHoursTable.map((reply) {
.listDoctorWorkingHoursTable
.map((reply) {
return DoctorReplyWidget(reply: reply); return DoctorReplyWidget(reply: reply);
}).toList(), }).toList(),
) )

@ -44,14 +44,14 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 0, currentIndex: 0,
name: TranslationBase.of(context).home, name: TranslationBase.of(context).home,
), ),
// BottomNavigationItem( BottomNavigationItem(
// icon: DoctorApp.message_icon, icon: DoctorApp.message_icon,
// activeIcon: DoctorApp.message_icon_active, activeIcon: DoctorApp.message_icon_active,
// changeIndex: _changeIndex, changeIndex: _changeIndex,
// index: _index, index: _index,
// currentIndex: 1, currentIndex: 1,
// name: TranslationBase.of(context).replay2, name: TranslationBase.of(context).replay2,
// ), ),
BottomNavigationItem( BottomNavigationItem(
icon: DoctorApp.schedule_icon, icon: DoctorApp.schedule_icon,
activeIcon: DoctorApp.scdedule_icon_active, activeIcon: DoctorApp.scdedule_icon_active,
@ -60,14 +60,14 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 2, currentIndex: 2,
name: TranslationBase.of(context).mySchedule, name: TranslationBase.of(context).mySchedule,
), ),
// BottomNavigationItem( BottomNavigationItem(
// icon: DoctorApp.menu_icon, icon: DoctorApp.qr_code,
// activeIcon: DoctorApp.menu_icon_active, activeIcon: DoctorApp.qr_code,
// changeIndex: _changeIndex, changeIndex: _changeIndex,
// index: _index, index: _index,
// currentIndex: 3, currentIndex: 3,
// name: TranslationBase.of(context).services, name: TranslationBase.of(context).qr,
// ) )
], ],
), ),
), ),

@ -403,6 +403,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_page_indicator:
dependency: transitive
description:
name: flutter_page_indicator
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
@ -410,6 +417,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.11" version: "1.0.11"
flutter_swiper:
dependency: "direct main"
description:
name: flutter_swiper
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -873,6 +887,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.1+3" version: "0.1.1+3"
transformer_page_view:
dependency: transitive
description:
name: transformer_page_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.6"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:

Loading…
Cancel
Save