view.dart 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import 'package:fis_lib_basictest/hardware_detection/widgets/camera_ui.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:fis_ui/index.dart';
  4. import 'package:get/get.dart';
  5. import 'index.dart';
  6. import 'widgets/widgets.dart';
  7. class HardwareDetectionPage extends GetView<HardwareDetectionController> {
  8. HardwareDetectionPage({Key? key}) : super(key: key);
  9. final bigTitleStyle = TextStyle(
  10. fontSize: 24,
  11. );
  12. // 主视图
  13. Widget _buildView() {
  14. return Center(
  15. child: Container(
  16. padding: EdgeInsets.all(20),
  17. child: Column(
  18. crossAxisAlignment: CrossAxisAlignment.start,
  19. children: [
  20. Text("视频", style: bigTitleStyle),
  21. _decorateLine(),
  22. CameraDetection(),
  23. SizedBox(height: 20),
  24. CameraUI(),
  25. SizedBox(height: 40),
  26. Text("音频", style: bigTitleStyle),
  27. _decorateLine(),
  28. SpeakerDetection(),
  29. SizedBox(height: 20),
  30. SpeakerUI(),
  31. SizedBox(height: 40),
  32. MicrophoneDetection(),
  33. SizedBox(height: 20),
  34. MicrophoneUI(),
  35. SizedBox(height: 20),
  36. ElevatedButton(
  37. onPressed: controller.startDetectingAll,
  38. child: Text("检测所有设备"),
  39. )
  40. ],
  41. ),
  42. ),
  43. );
  44. }
  45. Widget _decorateLine() {
  46. return FContainer(
  47. height: 8,
  48. width: double.infinity,
  49. margin: EdgeInsets.only(top: 5, bottom: 10, right: 200),
  50. decoration: BoxDecoration(
  51. color: Colors.grey[300],
  52. borderRadius: BorderRadius.circular(3),
  53. ),
  54. );
  55. }
  56. @override
  57. Widget build(BuildContext context) {
  58. return GetBuilder<HardwareDetectionController>(
  59. builder: (_) {
  60. return Scaffold(
  61. appBar: AppBar(title: const Text("hardware_detection")),
  62. body: SafeArea(
  63. child: _buildView(),
  64. ),
  65. );
  66. },
  67. );
  68. }
  69. }