fix masalan
This commit is contained in:
parent
1f72573909
commit
d423053603
|
|
@ -69,5 +69,11 @@
|
||||||
<array>
|
<array>
|
||||||
<string>dev.flutter.background.refresh</string>
|
<string>dev.flutter.background.refresh</string>
|
||||||
</array>
|
</array>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
@ -52,7 +52,16 @@ class _AudioWaveState extends State<AudioWave> {
|
||||||
totalDuration = widget.totalDuration;
|
totalDuration = widget.totalDuration;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// listeners();
|
listeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
void listeners() async {
|
||||||
|
VoiceService.audioPlayer.playerStateStream.listen((event) async {
|
||||||
|
if (event.processingState == ProcessingState.completed) {
|
||||||
|
await VoiceService.audioPlayer.pause();
|
||||||
|
await VoiceService.audioPlayer.seek(Duration.zero);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -71,18 +80,12 @@ class _AudioWaveState extends State<AudioWave> {
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
StreamBuilder<PlaybackEvent>(
|
StreamBuilder<PlayerState>(
|
||||||
stream: VoiceService.audioPlayer.playbackEventStream,
|
stream: VoiceService.audioPlayer.playerStateStream,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (!snapshot.hasData) {
|
if (!snapshot.hasData) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (snapshot.data!.processingState ==
|
|
||||||
ProcessingState.completed) {
|
|
||||||
VoiceService.audioPlayer.pause();
|
|
||||||
VoiceService.audioPlayer.seek(Duration.zero);
|
|
||||||
}
|
|
||||||
if ((snapshot.data!.processingState ==
|
if ((snapshot.data!.processingState ==
|
||||||
ProcessingState.loading ||
|
ProcessingState.loading ||
|
||||||
snapshot.data!.processingState ==
|
snapshot.data!.processingState ==
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class DirectState extends CoreProvier {
|
||||||
isRecording = true;
|
isRecording = true;
|
||||||
Directory? tempDir;
|
Directory? tempDir;
|
||||||
if (!kIsWeb) {
|
if (!kIsWeb) {
|
||||||
tempDir = await getDownloadsDirectory();
|
tempDir = await getApplicationDocumentsDirectory();
|
||||||
}
|
}
|
||||||
_recorder.start(const RecordConfig(),
|
_recorder.start(const RecordConfig(),
|
||||||
path: kIsWeb
|
path: kIsWeb
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// ignore_for_file: library_private_types_in_public_api, deprecated_member_use
|
// ignore_for_file: library_private_types_in_public_api, deprecated_member_use
|
||||||
|
|
||||||
import 'package:didvan/constants/assets.dart';
|
import 'package:didvan/constants/assets.dart';
|
||||||
|
import 'package:didvan/views/widgets/didvan/text.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -74,12 +75,12 @@ class _WebViewState extends State<WebView> {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
// appBar: AppBar(
|
appBar: AppBar(
|
||||||
// title: const DidvanText(
|
title: const DidvanText(
|
||||||
// 'بازگشت به دیدوان',
|
'بازگشت به دیدوان',
|
||||||
// ),
|
),
|
||||||
// leading: const BackButton(),
|
leading: const BackButton(),
|
||||||
// ),
|
),
|
||||||
body: loading
|
body: loading
|
||||||
? Center(
|
? Center(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue