|
|
|
|
@ -12,6 +12,7 @@ import 'package:just_audio/just_audio.dart';
|
|
|
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
import 'package:share/share.dart';
|
|
|
|
|
import 'package:tangheem/api/tangheem_user_api_client.dart';
|
|
|
|
|
import 'package:tangheem/classes/colors.dart';
|
|
|
|
|
import 'package:tangheem/classes/utils.dart';
|
|
|
|
|
import 'package:tangheem/models/aya_tangheem_type_mapped.dart';
|
|
|
|
|
@ -120,6 +121,7 @@ class _AyaPlayerWidgetState extends State<AyaPlayerWidget> {
|
|
|
|
|
stream: _player.currentIndexStream,
|
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
|
final state = snapshot.data;
|
|
|
|
|
if (state == null) return SizedBox();
|
|
|
|
|
return Container(
|
|
|
|
|
width: 50.0,
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8),
|
|
|
|
|
@ -191,7 +193,7 @@ class _AyaPlayerWidgetState extends State<AyaPlayerWidget> {
|
|
|
|
|
commonIconButton("assets/icons/share_aya.svg", () {
|
|
|
|
|
_shareAya();
|
|
|
|
|
}),
|
|
|
|
|
// commonIconButton("assets/icons/bookmark.svg", () {}),
|
|
|
|
|
// commonIconButton("assets/icons/bookmark.svg", () {}),
|
|
|
|
|
// commonIconButton("assets/icons/audio_level.svg", () async {
|
|
|
|
|
// // var vol = await VolumeController.getVolume();
|
|
|
|
|
// VolumeController.maxVolume();
|
|
|
|
|
@ -334,8 +336,9 @@ class _AyaPlayerWidgetState extends State<AyaPlayerWidget> {
|
|
|
|
|
final tempDir = await getTemporaryDirectory();
|
|
|
|
|
final file = await File('${tempDir.path}/${DateTime.now().toString()}.png').create();
|
|
|
|
|
await file.writeAsBytes(pngBytes);
|
|
|
|
|
await TangheemUserApiClient().addStatistics(3);
|
|
|
|
|
await Share.shareFiles(['${file.path}']);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Share.shareFiles(['${file.path}']);
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Future.delayed(Duration(seconds: 1), () {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
|