123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:vnoteapp/components/button.dart';
- import 'package:vnoteapp/pages/medical/controller.dart';
- import 'package:vnoteapp/pages/medical/widgets/blood_pressure.dart';
- import 'package:vnoteapp/pages/medical/widgets/blood_sugar.dart';
- import 'package:vnoteapp/pages/medical/widgets/body_temperature.dart';
- import 'package:vnoteapp/pages/medical/widgets/body_bmi.dart';
- import 'package:vnoteapp/pages/medical/widgets/bool_oxygen.dart';
- import 'package:vnoteapp/store/store.dart';
- class MedicalPage extends GetView<MedicalController> {
- const MedicalPage({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Colors.white,
- // appBar: VAppBar(
- // titleWidget: const Text(
- // "健康检测",
- // style: TextStyle(fontSize: 24),
- // ),
- // ),
- body: Stack(
- children: [
- Row(
- children: [
- Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: controller.state.medicalMenuList
- .map(
- (e) => Material(
- borderRadius: const BorderRadius.only(
- topRight: Radius.circular(30),
- bottomRight: Radius.circular(30),
- ),
- child: Ink(
- decoration: const BoxDecoration(
- borderRadius: BorderRadius.only(
- topRight: Radius.circular(30),
- bottomRight: Radius.circular(30),
- ),
- ),
- child: InkWell(
- borderRadius: const BorderRadius.only(
- topRight: Radius.circular(30),
- bottomRight: Radius.circular(30),
- ),
- onTap: () {
- controller.state.currentTab = e.key;
- },
- child: Obx(
- () => _SideBar(
- title: e.diagnosticItem,
- isActive:
- controller.state.currentTab == e.key,
- ),
- )),
- ),
- ),
- )
- .toList(),
- ),
- Container(
- alignment: Alignment.topCenter,
- margin: const EdgeInsets.all(16).copyWith(top: 0),
- child: Image.asset(
- 'assets/images/exam/normalMeasurementChart.png',
- height: double.infinity,
- fit: BoxFit.fitWidth, // 设置图像的适应方式
- ),
- ),
- Expanded(
- child: Stack(
- children: [
- Container(
- padding: const EdgeInsets.all(16),
- child: Column(
- children: [
- _buildContent(),
- ],
- ),
- ),
- _buildSaveButton(),
- ],
- ),
- )
- ],
- ),
- _buildGenerateReport(),
- ],
- ),
- );
- }
- Widget _buildGenerateReport() {
- return Positioned(
- bottom: 100,
- left: 16,
- child: VButton(
- onTap: controller.saveCachedAppDataId,
- child: const Text(
- '生成报告',
- style: TextStyle(fontSize: 26),
- ),
- ),
- );
- }
- Widget _buildSaveButton() {
- return Obx(() {
- if (Store.user.currentSelectPatientInfo == null) {
- return const SizedBox();
- }
- return Positioned(
- bottom: 100,
- right: 16,
- child: VButton(
- onTap: controller.createDiagnosis,
- child: const Text(
- '保存',
- style: TextStyle(fontSize: 26),
- ),
- ),
- );
- });
- }
- Widget _buildContent() {
- return Obx(() {
- switch (controller.state.currentTab) {
- case 'Temp':
- return const BodyTemperature();
- case 'GLU':
- return const BloodSugar();
- case 'NIBP':
- return const BloodPressure();
- case 'SpO2':
- return const BloodOxygen();
- case 'BMI':
- return const BodyWeight();
- default:
- return const SizedBox();
- }
- });
- }
- }
- class _SideBar extends StatelessWidget {
- const _SideBar({
- required this.title,
- this.isActive,
- });
- final String title;
- final bool? isActive;
- @override
- Widget build(BuildContext context) {
- return Container(
- alignment: Alignment.centerLeft,
- width: 100,
- child: Container(
- margin: const EdgeInsets.only(bottom: 2),
- decoration: BoxDecoration(
- color: isActive!
- ? Theme.of(context).primaryColor
- : Theme.of(context).primaryColor.withOpacity(.2),
- borderRadius: const BorderRadius.only(
- topRight: Radius.circular(30),
- bottomRight: Radius.circular(30),
- ),
- ),
- alignment: Alignment.center,
- width: isActive! ? 100 : 90,
- height: 60,
- child: Text(
- title,
- style: TextStyle(
- fontSize: 26,
- color: isActive! ? Colors.white : Colors.black,
- ),
- ),
- ),
- );
- }
- }
|