design_3.0_demo_module
zaid_daoud 3 years ago
parent 871274433b
commit 799c9a50bd

@ -24,7 +24,6 @@ class _RecordSoundState extends State<RecordSound> {
FlutterSoundRecorder _myRecorder = FlutterSoundRecorder(); FlutterSoundRecorder _myRecorder = FlutterSoundRecorder();
bool _recorderIsOpened = false; bool _recorderIsOpened = false;
bool _recording = false; bool _recording = false;
bool _fastTab = false;
String _record; String _record;
Artboard _rive; Artboard _rive;
@ -69,13 +68,14 @@ class _RecordSoundState extends State<RecordSound> {
} }
_startRecording() async { _startRecording() async {
_fastTab = false;
// await Permission.camera // await Permission.camera
PermissionStatus status = await Permission.microphone.request(); PermissionStatus status = await Permission.microphone.request();
if (!status.isGranted) { if (!status.isGranted) {
PermissionStatus status = await Permission.microphone.request(); PermissionStatus status = await Permission.microphone.request();
Fluttertoast.showToast(msg: "Permission Denied"); if (!status.isGranted) {
return; Fluttertoast.showToast(msg: "Permission Denied");
return;
}
} }
_rive.addController(SimpleAnimation('recording')); _rive.addController(SimpleAnimation('recording'));
if (!_recorderIsOpened) { if (!_recorderIsOpened) {
@ -91,7 +91,6 @@ class _RecordSoundState extends State<RecordSound> {
_stopRecording() async { _stopRecording() async {
if (!_recording) { if (!_recording) {
_fastTab = true;
setState(() {}); setState(() {});
return; return;
} }
@ -182,11 +181,6 @@ class _RecordSoundState extends State<RecordSound> {
color: Colors.transparent, color: Colors.transparent,
child: GestureDetector( child: GestureDetector(
//key: ValueKey("voice"), //key: ValueKey("voice"),
child: const Padding(
padding: EdgeInsets.all(12.0),
child: Icon(Icons.mic),
),
onTapDown: widget.enabled onTapDown: widget.enabled
? (TapDownDetails details) async { ? (TapDownDetails details) async {
_startRecording(); _startRecording();
@ -202,6 +196,8 @@ class _RecordSoundState extends State<RecordSound> {
_cancelRecording(); _cancelRecording();
} }
: null, : null,
//key: ValueKey("voice"),
child: const Padding(padding: EdgeInsets.all(12.0), child: Icon(Icons.mic)),
), ),
), ),
], ],

Loading…
Cancel
Save