You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PatientApp-KKUMC/lib/pages/medical/prescriptions/prescriptions_home_page.dart

133 lines
5.5 KiB
Dart

import 'dart:ui';
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class HomePrescriptionsPage extends StatefulWidget {
@override
_HomePrescriptionsPageState createState() => _HomePrescriptionsPageState();
}
class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with SingleTickerProviderStateMixin {
late TabController _tabController;
List<ImagesInfo> imagesInfo =[];
late ProjectViewModel projectViewModel;
@override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
imagesInfo.add(ImagesInfo(
imageEn: 'https://mchisapp.kku.edu.sa/Images/imges-info/presc/en/0.png', imageAr: 'https://mchisapp.kku.edu.sa/Images/imges-info/presc/ar/0.png'));
// imagesInfo.add(ImagesInfo(
// imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png'));
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescriptions,
description: TranslationBase.of(context).infoPrescriptions,
infoList: TranslationBase.of(context).infoPrescriptionsPoints,
imagesInfo: imagesInfo,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
body: Column(
children: <Widget>[
Expanded(
child: PrescriptionsPage(
FilterType.Clinic,
prescriptionsViewModel: model,
showOrderLog: () async {
_tabController.animateTo(2);
// await model.getPrescriptionsOrders(showLoading: true);
setState(() {});
},
),
)
// 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: 15,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.48,
// ),
// unselectedLabelStyle: TextStyle(
// fontSize: 15,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.48,
// ),
// tabs: [
// Text(TranslationBase.of(context).byClinic, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
// Text(TranslationBase.of(context).byHospital, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
// Text(TranslationBase.of(context).orderLog, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
// ],
// ),
// Expanded(
// child: TabBarView(
// physics: BouncingScrollPhysics(),
// controller: _tabController,
// children: <Widget>[
// PrescriptionsPage(
// FilterType.Clinic,
// prescriptionsViewModel: model,
// showOrderLog: () async {
// _tabController.animateTo(2);
// // await model.getPrescriptionsOrders(showLoading: true);
// setState(() {});
// },
// ),
// PrescriptionsPage(
// FilterType.Hospital,
// prescriptionsViewModel: model,
// showOrderLog: () async {
// _tabController.animateTo(2);
// // await model.getPrescriptionsOrders(showLoading: true);
// setState(() {});
// },
// ),
// PrescriptionsHistoryPage(
// prescriptionsViewModel: model,
// showOrderLog: () async {
// await model.getPrescriptionsOrders(showLoading: true);
// setState(() {});
// },
// )
// ],
// ),
// )
],
),
),
);
}
}