import 'package:fis_lib_basictest/hardware_detection/widgets/camera_ui.dart'; import 'package:flutter/material.dart'; import 'package:fis_ui/index.dart'; import 'package:get/get.dart'; import 'index.dart'; import 'widgets/widgets.dart'; class HardwareDetectionPage extends GetView { HardwareDetectionPage({Key? key}) : super(key: key); final bigTitleStyle = TextStyle( fontSize: 24, ); // 主视图 Widget _buildView() { return Center( child: Container( padding: EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text("视频", style: bigTitleStyle), _decorateLine(), CameraDetection(), SizedBox(height: 20), CameraUI(), SizedBox(height: 40), Text("音频", style: bigTitleStyle), _decorateLine(), SpeakerDetection(), SizedBox(height: 20), SpeakerUI(), SizedBox(height: 40), MicrophoneDetection(), SizedBox(height: 20), MicrophoneUI(), SizedBox(height: 20), ElevatedButton( onPressed: controller.startDetectingAll, child: Text("检测所有设备"), ) ], ), ), ); } Widget _decorateLine() { return FContainer( height: 8, width: double.infinity, margin: EdgeInsets.only(top: 5, bottom: 10, right: 200), decoration: BoxDecoration( color: Colors.grey[300], borderRadius: BorderRadius.circular(3), ), ); } @override Widget build(BuildContext context) { return GetBuilder( builder: (_) { return Scaffold( appBar: AppBar(title: const Text("hardware_detection")), body: SafeArea( child: _buildView(), ), ); }, ); } }