e-referral work in progress.
parent
c701572dde
commit
171bd644d1
@ -0,0 +1,16 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class HmgServices {
|
||||||
|
int action;
|
||||||
|
String title;
|
||||||
|
String subTitle;
|
||||||
|
String icon;
|
||||||
|
bool isLogin;
|
||||||
|
bool isLocked;
|
||||||
|
Color bgColor;
|
||||||
|
Color textColor;
|
||||||
|
String route;
|
||||||
|
HmgServices(this.action, this.title, this.subTitle, this.icon, this.isLogin, {this.isLocked = false, this.bgColor = Colors.white, this.textColor = Colors.black, this.route=''});
|
||||||
|
}
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_export.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/e_referral/new_referral.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class EReferralPage extends StatefulWidget {
|
||||||
|
const EReferralPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_EReferralPageState createState() => _EReferralPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EReferralPageState extends State<EReferralPage>
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
bool isNewReferral = true;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.bgScaffoldColor,
|
||||||
|
body: CollapsingListView(
|
||||||
|
title:"E Referral".needTranslation,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Consumer<PrescriptionsViewModel>(builder: (context, model, child) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
CustomButton(
|
||||||
|
text: "New Referral".needTranslation,
|
||||||
|
onPressed: () {
|
||||||
|
isNewReferral =true;
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
backgroundColor: model.isSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
|
||||||
|
borderColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withOpacity(0.2),
|
||||||
|
textColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
borderRadius: 10,
|
||||||
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
|
height: 40.h,
|
||||||
|
),
|
||||||
|
SizedBox(width: 8.h),
|
||||||
|
CustomButton(
|
||||||
|
text: "Search Referral".needTranslation,
|
||||||
|
onPressed: () {
|
||||||
|
isNewReferral =false;
|
||||||
|
},
|
||||||
|
backgroundColor: model.isSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor,
|
||||||
|
borderColor: model.isSortByClinic ? AppColors.textColor.withOpacity(0.2) : AppColors.primaryRedColor,
|
||||||
|
textColor: model.isSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
borderRadius: 10,
|
||||||
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
|
height: 40.h,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingSymmetrical(24.h, 0.h),
|
||||||
|
SizedBox(height: 20.h),
|
||||||
|
isNewReferral ? NewEReferral() : SizedBox(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,172 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
|
||||||
|
class NewEReferral extends StatefulWidget {
|
||||||
|
NewEReferral();
|
||||||
|
|
||||||
|
@override
|
||||||
|
_NewEReferralState createState() => _NewEReferralState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _NewEReferralState extends State<NewEReferral> with TickerProviderStateMixin {
|
||||||
|
late PageController _controller;
|
||||||
|
int _currentIndex = 0;
|
||||||
|
int pageSelected = 2;
|
||||||
|
|
||||||
|
// CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_controller = new PageController();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
changePageViewIndex(pageIndex) {
|
||||||
|
_controller.jumpToPage(pageIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
body: Container(
|
||||||
|
height: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: EdgeInsets.only(left: 12,right: 12,top: 12),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: showProgress(
|
||||||
|
title: "Requester Info".needTranslation,
|
||||||
|
status: _currentIndex == 0
|
||||||
|
? "InProgress".needTranslation
|
||||||
|
: _currentIndex > 0
|
||||||
|
? "Completed".needTranslation
|
||||||
|
: "Locked".needTranslation,
|
||||||
|
color: _currentIndex == 0 ? AppColors.infoColor : AppColors.successColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: showProgress(
|
||||||
|
title:"Patient Info".needTranslation,
|
||||||
|
status: _currentIndex == 1
|
||||||
|
? "InProgress".needTranslation
|
||||||
|
: _currentIndex > 1
|
||||||
|
? "Completed".needTranslation
|
||||||
|
: "Locked".needTranslation,
|
||||||
|
color: _currentIndex == 1
|
||||||
|
? AppColors.infoColor
|
||||||
|
: _currentIndex > 1
|
||||||
|
? AppColors.successColor
|
||||||
|
: AppColors.greyColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
showProgress(
|
||||||
|
title: "Other Info".needTranslation,
|
||||||
|
status: _currentIndex == 2 ? "InProgress".needTranslation :"Locked".needTranslation,
|
||||||
|
color: _currentIndex == 2
|
||||||
|
? AppColors.infoColor
|
||||||
|
: _currentIndex > 3
|
||||||
|
? AppColors.successColor
|
||||||
|
: AppColors.greyColor,
|
||||||
|
isNeedBorder: false,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: PageView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
controller: _controller,
|
||||||
|
onPageChanged: (index) {
|
||||||
|
setState(() {
|
||||||
|
_currentIndex = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: <Widget>[
|
||||||
|
// NewEReferralStepOnePage(
|
||||||
|
// changePageViewIndex: changePageViewIndex,
|
||||||
|
// createEReferralRequestModel: createEReferralRequestModel,
|
||||||
|
// ),
|
||||||
|
// NewEReferralStepTowPage(
|
||||||
|
// changePageViewIndex: changePageViewIndex,
|
||||||
|
// createEReferralRequestModel: createEReferralRequestModel,
|
||||||
|
// ),
|
||||||
|
// NewEReferralStepThreePage(
|
||||||
|
// changePageViewIndex: changePageViewIndex,
|
||||||
|
// createEReferralRequestModel: createEReferralRequestModel,
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget showProgress({required String title, required String status, required Color color, bool isNeedBorder = true}) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 26,
|
||||||
|
height: 26,
|
||||||
|
// decoration: containerRadius(color, 200),
|
||||||
|
child: Icon(
|
||||||
|
Icons.done,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (isNeedBorder)
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child:Divider(),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// mHeight(8),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
letterSpacing: -0.44,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// mHeight(2),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(5),
|
||||||
|
// decoration: containerRadius(color.withOpacity(0.2), 4),
|
||||||
|
child: Text(
|
||||||
|
status,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 8,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
letterSpacing: -0.32,
|
||||||
|
color: color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/hmg_services/models/hmg_services.dart';
|
||||||
|
import 'package:hmg_patient_app_new/routes/app_routes.dart';
|
||||||
|
import 'package:hmg_patient_app_new/services/navigation_service.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class ServiceGridView extends StatelessWidget {
|
||||||
|
HmgServices hmgServices;
|
||||||
|
int index;
|
||||||
|
bool isHomePage;
|
||||||
|
bool isLocked;
|
||||||
|
ServiceGridView(this.hmgServices, this.index, this.isHomePage, {super.key, this.isLocked = false});
|
||||||
|
static final NavigationService _navigationService = getIt.get<NavigationService>();
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
_navigationService.pushAndReplace(hmgServices.route);
|
||||||
|
},
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 48,
|
||||||
|
width: 48,
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
margin: EdgeInsets.all(0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: hmgServices.bgColor,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child:Utils.buildSvgWithAssets (
|
||||||
|
icon: hmgServices.icon,
|
||||||
|
height: 21,
|
||||||
|
width: 21,
|
||||||
|
fit: BoxFit.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
hmgServices.title.toText12(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color:hmgServices.textColor,
|
||||||
|
|
||||||
|
),
|
||||||
|
// Text(
|
||||||
|
// hmgServices.subTitle,
|
||||||
|
// textAlign: TextAlign.left,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 14,
|
||||||
|
// fontWeight: FontWeight.w500,
|
||||||
|
// color: hmgServices.textColor,
|
||||||
|
// )),
|
||||||
|
// )
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue