hyzp_ybqx-Commit123:版本号更新为version: 1.4.26+20220426。使用单例 final myPlayer = AudioCache()优化mp3播放。准备使用flutter_background_service 0.0.1+21 实现后台定时提醒
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
/build/
|
||||
android/app/release/app-release.apk
|
||||
android/app/release/output.json
|
||||
pubspec.lock
|
||||
|
||||
# Web related
|
||||
lib/generated_plugin_registrant.dart
|
||||
|
||||
@@ -6,6 +6,8 @@ import 'dart:math';
|
||||
|
||||
import 'package:ai_save_account/ai_save_account.dart';
|
||||
import 'package:audioplayers/audio_cache.dart';
|
||||
|
||||
// import 'package:audioplayers/audio_cache.dart';
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:convert/convert.dart';
|
||||
import 'package:crypto/crypto.dart' as crypto;
|
||||
@@ -17,10 +19,28 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
//import '../my_wechat_assets_picker_fix/my_asset_picker_1.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:hyzp_ybqx/provider/player_region.dart';
|
||||
// import 'package:just_audio/just_audio.dart';
|
||||
|
||||
import 'UserInfo.dart';
|
||||
import 'dioFun.dart';
|
||||
|
||||
// final myPlayer = AudioPlayer();
|
||||
final myPlayer = AudioCache();
|
||||
|
||||
// myPlayMp3({String asset = 'assets/audio/yinxiao1064.mp3'}) {
|
||||
// // myPlayer.setAsset(asset, preload: true).then((value) {
|
||||
// // myPlayer.play();
|
||||
// // });
|
||||
// // myPlayer.setAsset(asset).then((value) {
|
||||
// // myPlayer.play();
|
||||
// // });
|
||||
// }
|
||||
|
||||
myPlayMp3({String asset = 'audio/语音提醒.mp3'}) {
|
||||
myPlayer.play(asset);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////
|
||||
// begin hyzp_ybqx-Commit022-区县切换新方法-OK
|
||||
|
||||
@@ -112,7 +132,8 @@ Future doRemind() async {
|
||||
// import 'package:audioplayers/audio_cache.dart';
|
||||
// print("播放:语音提醒.mp3");
|
||||
if (listReviewed.length > 0) {
|
||||
AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
||||
// AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
||||
myPlayMp3(asset: 'audio/语音提醒.mp3');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_screenutil/screen_util.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:audioplayers/audio_cache.dart';
|
||||
// import 'package:audioplayers/audio_cache.dart';
|
||||
import '../../components/commonFun.dart';
|
||||
import '../../components/dioFun.dart';
|
||||
|
||||
@@ -56,7 +56,8 @@ class _TakePictuerState extends State<TakePictuer> {
|
||||
Future<void> _onCamera() async {
|
||||
await Future.delayed(Duration(milliseconds: 1000), () {
|
||||
print('开始拍照...');
|
||||
AudioCache().play(File('audio/yinxiao1064.mp3').path); //播放咔嚓声
|
||||
// AudioCache().play(File('audio/yinxiao1064.mp3').path); //播放咔嚓声
|
||||
myPlayMp3(asset: 'assets/audio/yinxiao1064.mp3'); //播放咔嚓声
|
||||
onTakePictureButtonPressed();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import '../../components/commonFun.dart';
|
||||
import '../../services/ServiceLocator.dart';
|
||||
import '../../services/Storage.dart';
|
||||
import 'page1_work.dart';
|
||||
import 'package:audioplayers/audio_cache.dart';
|
||||
// import 'package:audioplayers/audio_cache.dart';
|
||||
|
||||
class Tabs extends StatefulWidget {
|
||||
Tabs({Key key, this.arguments = 0}) : super(key: key);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:audioplayers/audio_cache.dart';
|
||||
// import 'package:audioplayers/audio_cache.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:audioplayers/audio_cache.dart';
|
||||
// import 'package:audioplayers/audio_cache.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@@ -109,7 +109,8 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
// Storage.setBool('bVoiceRemind', bVoiceRemind);
|
||||
if (bVoiceRemind) {
|
||||
print("播放语音提醒");
|
||||
AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
||||
// AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
||||
myPlayMp3(asset: 'audio/语音提醒.mp3');
|
||||
}
|
||||
getListView();
|
||||
});
|
||||
@@ -162,7 +163,8 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
Storage.setInt('nRemindGap', g_remindGap);
|
||||
setRemindTimer(enable: g_bVoiceRemind);
|
||||
|
||||
AudioCache().play(File('audio/yinxiao1064.mp3').path); //音效提醒
|
||||
// AudioCache().play(File('audio/yinxiao1064.mp3').path); //音效提醒
|
||||
myPlayMp3(asset: 'assets/audio/yinxiao1064.mp3'); //音效提醒
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -251,6 +251,13 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_background_service:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_background_service
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.0.1+21"
|
||||
flutter_blurhash:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
+12
-1
@@ -64,7 +64,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
#version: 1.4.21+20220319
|
||||
#version: 1.4.22+20220320
|
||||
#version: 1.4.23+20220408
|
||||
version: 1.4.26+20220412
|
||||
version: 1.4.26+20220426
|
||||
|
||||
environment:
|
||||
sdk: ">=2.7.0 <3.0.0"
|
||||
@@ -98,6 +98,17 @@ dependencies:
|
||||
|
||||
camera: ^0.5.8+11
|
||||
audioplayers: ^0.16.2
|
||||
flutter_background_service: ^0.0.1+21
|
||||
|
||||
# just_audio: ^0.4.0 # 报错
|
||||
# just_audio: ^0.3.4 # OK,不支持中文路径
|
||||
# just_audio: ^0.3.0 # OK
|
||||
# just_audio: ^0.1.0 # OK
|
||||
|
||||
# just_audio: ^0.6.15+1 # 引入该插件编译时报错如下
|
||||
# Could not determine the dependencies of task ':app:processDebugResources'.
|
||||
# > Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
|
||||
# > Could not resolve androidx.media2:media2-common:[1.1.0-alpha01].
|
||||
|
||||
encrypt: ^4.1.0
|
||||
device_info: ^1.0.0
|
||||
|
||||
Reference in New Issue
Block a user