no_card_reader_view.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import '../index.dart';
  4. class NoCardReaderView extends GetView<CardReaderController> {
  5. const NoCardReaderView({super.key});
  6. @override
  7. Widget build(BuildContext context) {
  8. return Column(
  9. mainAxisAlignment: MainAxisAlignment.center,
  10. children: [
  11. const Icon(
  12. Icons.warning_amber_rounded,
  13. size: 80,
  14. color: Colors.red,
  15. ),
  16. const SizedBox(height: 20),
  17. Text(
  18. controller.isCardReaderBinding ? '未连接读卡器' : '未绑定读卡器',
  19. style: const TextStyle(
  20. fontSize: 26,
  21. fontWeight: FontWeight.bold,
  22. ),
  23. ),
  24. const SizedBox(height: 20),
  25. Text(
  26. controller.isCardReaderBinding ? "读卡器连接失败请检查" : '请在设置中心绑定读卡器',
  27. style: const TextStyle(
  28. fontSize: 18,
  29. color: Colors.grey,
  30. ),
  31. textAlign: TextAlign.center,
  32. ),
  33. const SizedBox(height: 20),
  34. if (controller.isCardReaderBinding)
  35. ElevatedButton(
  36. onPressed: () {
  37. controller.checkReader();
  38. },
  39. child: const Text(
  40. '重试',
  41. style: TextStyle(fontSize: 20),
  42. ),
  43. ),
  44. const SizedBox(height: 40),
  45. ],
  46. );
  47. }
  48. }