view.dart 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vitalapp/architecture/values/features.dart';
  4. import 'package:vitalapp/pages/home/controller.dart';
  5. import 'package:vitalapp/store/store.dart';
  6. import 'controller.dart';
  7. import 'widgets/base_info.dart';
  8. import 'widgets/functions_panel.dart';
  9. import 'widgets/tag_cards.dart';
  10. class PatientDetailPage extends GetView<PatientDetailController> {
  11. const PatientDetailPage({super.key});
  12. @override
  13. Widget build(BuildContext context) {
  14. return Scaffold(
  15. backgroundColor: Colors.grey.shade200,
  16. body: Container(
  17. margin: const EdgeInsets.only(top: 2),
  18. child: Row(
  19. children: [
  20. Container(
  21. width: 440,
  22. padding: const EdgeInsets.only(
  23. left: 12,
  24. top: 8,
  25. // right: 8,
  26. bottom: 8,
  27. ),
  28. child: Container(
  29. padding: const EdgeInsets.only(right: 8),
  30. child: Column(
  31. mainAxisSize: MainAxisSize.max,
  32. children: [
  33. const BaseInfoCard(),
  34. const SizedBox(height: 12),
  35. if (Store.user
  36. .hasFeature(FeatureKeys.CrowdClassification)) ...[
  37. const SizedBox(height: 12),
  38. Expanded(
  39. child: CrowdLabelsCard(),
  40. ),
  41. ],
  42. if (Store.user.hasFeature(FeatureKeys.ContractStatus)) ...[
  43. const SizedBox(height: 12),
  44. const Expanded(child: FollowupTipsCard()),
  45. ],
  46. if (Store.user.hasFeature(FeatureKeys.RecentTestRecords))
  47. FutureBuilder(
  48. future: controller.onReadLastRecordInfo(),
  49. builder:
  50. (BuildContext context, AsyncSnapshot snapshot) {
  51. return Expanded(
  52. child: LatestRecordCard(
  53. connectionState: snapshot.connectionState,
  54. ),
  55. );
  56. },
  57. ),
  58. ],
  59. ),
  60. ),
  61. ),
  62. const Expanded(child: FunctionsPanel()),
  63. ],
  64. ),
  65. ),
  66. );
  67. }
  68. }