|
|
|
|
@ -35,97 +35,99 @@ class LabResultDetails extends StatelessWidget {
|
|
|
|
|
LabViewModel labViewModel = Provider.of<LabViewModel>(context, listen: false);
|
|
|
|
|
final appState = getIt.get<AppState>();
|
|
|
|
|
return Scaffold(
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CollapsingListView(
|
|
|
|
|
title: LocaleKeys.labResultDetails.tr(context: context),
|
|
|
|
|
// aiOverview: () async {
|
|
|
|
|
// final _dialogService = getIt.get<DialogService>();
|
|
|
|
|
// await _dialogService.showCommonBottomSheetWithoutH(
|
|
|
|
|
// message: LocaleKeys.aiDisclaimer.tr(),
|
|
|
|
|
// label: LocaleKeys.consent.tr(),
|
|
|
|
|
// okLabel: LocaleKeys.acceptLbl.tr(),
|
|
|
|
|
// cancelLabel: LocaleKeys.rejectView.tr(),
|
|
|
|
|
// onOkPressed: () {
|
|
|
|
|
// context.pop();
|
|
|
|
|
// labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
|
|
|
|
|
// },
|
|
|
|
|
// onCancelPressed: () {
|
|
|
|
|
// context.pop();
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
spacing: 16.h,
|
|
|
|
|
children: [
|
|
|
|
|
LabNameAndStatus(context),
|
|
|
|
|
getLabDescription(context),
|
|
|
|
|
LabGraph(context),
|
|
|
|
|
Selector<LabViewModel, LabOrderResponseByAi?>(
|
|
|
|
|
selector: (_, model) => model.labOrderResponseByAi,
|
|
|
|
|
builder: (_, aiData, __) {
|
|
|
|
|
if (aiData != null) {
|
|
|
|
|
return AiAnalysisWidget(data: aiData).paddingOnly(bottom: 16.h);
|
|
|
|
|
}
|
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(24.h),
|
|
|
|
|
body: Consumer<LabViewModel>(builder: (context, labVM, child) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CollapsingListView(
|
|
|
|
|
title: LocaleKeys.labResultDetails.tr(context: context),
|
|
|
|
|
// aiOverview: () async {
|
|
|
|
|
// final _dialogService = getIt.get<DialogService>();
|
|
|
|
|
// await _dialogService.showCommonBottomSheetWithoutH(
|
|
|
|
|
// message: LocaleKeys.aiDisclaimer.tr(),
|
|
|
|
|
// label: LocaleKeys.consent.tr(),
|
|
|
|
|
// okLabel: LocaleKeys.acceptLbl.tr(),
|
|
|
|
|
// cancelLabel: LocaleKeys.rejectView.tr(),
|
|
|
|
|
// onOkPressed: () {
|
|
|
|
|
// context.pop();
|
|
|
|
|
// labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
|
|
|
|
|
// },
|
|
|
|
|
// onCancelPressed: () {
|
|
|
|
|
// context.pop();
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
spacing: 16.h,
|
|
|
|
|
children: [
|
|
|
|
|
LabNameAndStatus(context),
|
|
|
|
|
getLabDescription(context),
|
|
|
|
|
LabGraph(context),
|
|
|
|
|
Selector<LabViewModel, LabOrderResponseByAi?>(
|
|
|
|
|
selector: (_, model) => model.labOrderResponseByAi,
|
|
|
|
|
builder: (_, aiData, __) {
|
|
|
|
|
if (aiData != null) {
|
|
|
|
|
return AiAnalysisWidget(data: aiData).paddingOnly(bottom: 16.h);
|
|
|
|
|
}
|
|
|
|
|
return const SizedBox.shrink();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(24.h),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.h,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 56.h,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(12.r),
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
|
stops: [0.236, 1.0], // 53.6% and 100%
|
|
|
|
|
colors: [
|
|
|
|
|
Color(0xFF8A38F5), // Transparent
|
|
|
|
|
Color(0xFFE20BBB), // Solid #F8F8F8
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
labVM.labOrderResponseByAi == null ? Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.h,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 4.w, left: 4.w),
|
|
|
|
|
child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 56.h,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(12.r),
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
|
stops: [0.236, 1.0], // 53.6% and 100%
|
|
|
|
|
colors: [
|
|
|
|
|
Color(0xFF8A38F5), // Transparent
|
|
|
|
|
Color(0xFFE20BBB), // Solid #F8F8F8
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.generateAiAnalysisResult.tr(context: context).toText16(isBold: true)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 24.h).onPress(() async {
|
|
|
|
|
final _dialogService = getIt.get<DialogService>();
|
|
|
|
|
await _dialogService.showCommonBottomSheetWithoutH(
|
|
|
|
|
message: LocaleKeys.aiDisclaimer.tr(),
|
|
|
|
|
label: LocaleKeys.consent.tr(),
|
|
|
|
|
okLabel: LocaleKeys.acceptLbl.tr(),
|
|
|
|
|
cancelLabel: LocaleKeys.rejectView.tr(),
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
context.pop();
|
|
|
|
|
labViewModel.getAiOverviewSingleLabResult(
|
|
|
|
|
langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
|
|
|
|
|
},
|
|
|
|
|
onCancelPressed: () {
|
|
|
|
|
context.pop();
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 4.w, left: 4.w),
|
|
|
|
|
child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.generateAiAnalysisResult.tr(context: context).toText16(isBold: true, color: Colors.white)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 24.h).onPress(() async {
|
|
|
|
|
final _dialogService = getIt.get<DialogService>();
|
|
|
|
|
await _dialogService.showCommonBottomSheetWithoutH(
|
|
|
|
|
message: LocaleKeys.aiDisclaimer.tr(),
|
|
|
|
|
label: LocaleKeys.consent.tr(),
|
|
|
|
|
okLabel: LocaleKeys.acceptLbl.tr(),
|
|
|
|
|
cancelLabel: LocaleKeys.rejectView.tr(),
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
context.pop();
|
|
|
|
|
labViewModel.getAiOverviewSingleLabResult(
|
|
|
|
|
langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
|
|
|
|
|
},
|
|
|
|
|
onCancelPressed: () {
|
|
|
|
|
context.pop();
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
) : SizedBox.shrink(),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|