|
|
|
@ -7,7 +7,8 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
@ -20,8 +21,7 @@ class HomeReportPage extends StatefulWidget {
|
|
|
|
|
_HomeReportPageState createState() => _HomeReportPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _HomeReportPageState extends State<HomeReportPage>
|
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
|
class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProviderStateMixin {
|
|
|
|
|
TabController _tabController;
|
|
|
|
|
List<ImagesInfo> imagesInfo = List();
|
|
|
|
|
|
|
|
|
@ -41,20 +41,11 @@ class _HomeReportPageState extends State<HomeReportPage>
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
imagesInfo.add(ImagesInfo(
|
|
|
|
|
imageEn:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',
|
|
|
|
|
imageAr:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
|
|
|
|
|
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
|
|
|
|
|
imagesInfo.add(ImagesInfo(
|
|
|
|
|
imageEn:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',
|
|
|
|
|
imageAr:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png'));
|
|
|
|
|
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png'));
|
|
|
|
|
imagesInfo.add(ImagesInfo(
|
|
|
|
|
imageEn:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',
|
|
|
|
|
imageAr:
|
|
|
|
|
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
|
|
|
|
|
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
|
|
|
|
|
return BaseView<ReportsViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getReports(), //model.getPrescriptions(),
|
|
|
|
|
builder: (_, model, widget) => AppScaffold(
|
|
|
|
@ -63,129 +54,71 @@ class _HomeReportPageState extends State<HomeReportPage>
|
|
|
|
|
title: TranslationBase.of(context).medReport,
|
|
|
|
|
description: TranslationBase.of(context).infoMonthReport,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
showNewAppBar: true,
|
|
|
|
|
showNewAppBarTitle: true,
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
body: Scaffold(
|
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
|
appBar: PreferredSize(
|
|
|
|
|
preferredSize: Size.fromHeight(65.0),
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 1,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: BackdropFilter(
|
|
|
|
|
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.scaffoldBackgroundColor
|
|
|
|
|
.withOpacity(0.8),
|
|
|
|
|
height: 70.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
TabBar(
|
|
|
|
|
isScrollable: true,
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
indicatorWeight: 3.0,
|
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
labelColor: Color(0xff2B353E),
|
|
|
|
|
unselectedLabelColor: Color(0xff575757),
|
|
|
|
|
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
|
|
|
|
|
labelStyle: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
),
|
|
|
|
|
unselectedLabelStyle: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
),
|
|
|
|
|
tabs: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).requested,
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 60.0,
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.9,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
bottom: BorderSide(
|
|
|
|
|
color: Theme.of(context).dividerColor,
|
|
|
|
|
width: 0.7),
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: TabBar(
|
|
|
|
|
isScrollable: true,
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
indicatorWeight: 5.0,
|
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
|
labelColor: Theme.of(context).primaryColor,
|
|
|
|
|
unselectedLabelColor: Colors.grey[800],
|
|
|
|
|
tabs: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.20,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(TranslationBase.of(context).requested,fontSize: 11,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.20,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(TranslationBase.of(context).ready,fontSize: 11,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.20,
|
|
|
|
|
child: Center(
|
|
|
|
|
child:
|
|
|
|
|
Texts(TranslationBase.of(context).completed,fontSize: 11,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.20,
|
|
|
|
|
child: Center(
|
|
|
|
|
child:
|
|
|
|
|
Texts(TranslationBase.of(context).cancelled,fontSize: 11,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).ready,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).completed,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).cancelled,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if(model.user!=null)
|
|
|
|
|
if (model.user != null)
|
|
|
|
|
Expanded(
|
|
|
|
|
child: TabBarView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ReportListWidget(
|
|
|
|
|
reportList: model.reportsOrderRequestList,
|
|
|
|
|
emailAddress: model.user.emailAddress
|
|
|
|
|
),
|
|
|
|
|
ReportListWidget(
|
|
|
|
|
reportList: model.reportsOrderReadyList,
|
|
|
|
|
emailAddress: model.user.emailAddress
|
|
|
|
|
),
|
|
|
|
|
ReportListWidget(
|
|
|
|
|
reportList: model.reportsOrderCompletedList,
|
|
|
|
|
emailAddress: model.user.emailAddress
|
|
|
|
|
),
|
|
|
|
|
ReportListWidget(
|
|
|
|
|
reportList: model.reportsOrderCanceledList,
|
|
|
|
|
emailAddress: model.user.emailAddress
|
|
|
|
|
),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderCompletedList, emailAddress: model.user.emailAddress),
|
|
|
|
|
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 110,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: projectViewModel.havePrivilege(21) ?Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: 90,
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: Button(
|
|
|
|
|
label: TranslationBase.of(context).requestMedicalReport,
|
|
|
|
|
backgroundColor: Colors.grey[800],
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: MedicalReports(),
|
|
|
|
|
if (projectViewModel.havePrivilege(21))
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
|
|
|
|
|
child: DefaultButton(
|
|
|
|
|
TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach,
|
|
|
|
|
() => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: MedicalReports(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
):null,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|