speaker_ui.dart 641 B

1234567891011121314151617181920212223
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import '../index.dart';
  4. import 'speaker_wave.dart';
  5. class SpeakerUI extends GetView<HardwareDetectionController> {
  6. @override
  7. Widget build(BuildContext context) {
  8. return Obx(() {
  9. if (controller.state.speakerList.isEmpty) {
  10. return Container();
  11. }
  12. return controller.state.isDisplaySpeakerWave
  13. ? SpeakerWave(
  14. audioPlayer: controller.flutterSound,
  15. isPlaying: controller.state.detectingSpeaker,
  16. width: 250.0,
  17. height: 40.0,
  18. )
  19. : Container();
  20. });
  21. }
  22. }