view.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vitalapp/pages/widgets/function_button.dart';
  4. import 'controller.dart';
  5. class SettingsPage extends GetView<SettingsController> {
  6. const SettingsPage({super.key});
  7. @override
  8. Widget build(BuildContext context) {
  9. return Container(
  10. padding: const EdgeInsets.all(8),
  11. color: Colors.grey.shade200,
  12. alignment: Alignment.bottomLeft,
  13. child: Container(
  14. color: Colors.white,
  15. alignment: Alignment.center,
  16. child: Column(
  17. mainAxisAlignment: MainAxisAlignment.center,
  18. children: [
  19. Text(
  20. "当前版本:${controller.state.version}",
  21. style: const TextStyle(color: Colors.black, fontSize: 18),
  22. ),
  23. const SizedBox(height: 20),
  24. ElevatedButton.icon(
  25. icon: const Icon(Icons.exit_to_app),
  26. label: const Text("退出登录"),
  27. onPressed: () {
  28. controller.logOut();
  29. },
  30. ),
  31. ],
  32. ),
  33. ),
  34. );
  35. }
  36. List<Widget> _buildEntranceList(BuildContext context) {
  37. final list = <Widget>[];
  38. list.add(FunctionButton(
  39. label: "签名设置",
  40. icon: _buildIcon(Icons.edit_document, context),
  41. // onTap: controller.gotoInfo,
  42. ));
  43. list.add(FunctionButton(
  44. label: "退出登录",
  45. icon: _buildIcon(Icons.exit_to_app, context),
  46. onTap: controller.logOut,
  47. ));
  48. return list;
  49. }
  50. Widget _buildImgIcon(String assetName) {
  51. return Image.asset(
  52. "assets/images/patient/$assetName",
  53. width: 100,
  54. height: 100,
  55. fit: BoxFit.contain,
  56. );
  57. }
  58. Widget _buildIcon(IconData iconData, BuildContext context) {
  59. return Icon(
  60. iconData,
  61. size: 100,
  62. color: Theme.of(context).primaryColor,
  63. );
  64. }
  65. }