view.dart 2.4 KB

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