diff --git a/assets_audio_player_web/android/build.gradle b/assets_audio_player_web/android/build.gradle index 0add2a5b..058dd3e6 100644 --- a/assets_audio_player_web/android/build.gradle +++ b/assets_audio_player_web/android/build.gradle @@ -2,10 +2,10 @@ group 'com.github.florent37.assets_audio_player_web' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() - jcenter() + mavenCentral() } dependencies { @@ -17,12 +17,14 @@ buildscript { rootProject.allprojects { repositories { google() - jcenter() + mavenCentral() } } apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' +//apply plugin: 'com.android.application' +//apply plugin: 'kotlin-android' +//apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 28 @@ -39,6 +41,6 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.annotation:annotation:1.5.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "androidx.annotation:annotation:1.5.0" } diff --git a/assets_audio_player_web/android/src/main/kotlin/com/github/florent37/assets_audio_player_web/AssetsAudioPlayerWebPlugin.kt b/assets_audio_player_web/android/src/main/kotlin/com/github/florent37/assets_audio_player_web/AssetsAudioPlayerWebPlugin.kt index 76e1a209..42896c5f 100644 --- a/assets_audio_player_web/android/src/main/kotlin/com/github/florent37/assets_audio_player_web/AssetsAudioPlayerWebPlugin.kt +++ b/assets_audio_player_web/android/src/main/kotlin/com/github/florent37/assets_audio_player_web/AssetsAudioPlayerWebPlugin.kt @@ -1,3 +1,5 @@ +@file:Suppress("EmptyMethod", "EmptyMethod", "EmptyMethod", "EmptyMethod") + package com.github.florent37.assets_audio_player_web import androidx.annotation.NonNull; @@ -14,7 +16,7 @@ public class AssetsAudioPlayerWebPlugin: FlutterPlugin, MethodCallHandler { private lateinit var channel : MethodChannel - override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { //no-op for compatibility } @@ -25,11 +27,11 @@ public class AssetsAudioPlayerWebPlugin: FlutterPlugin, MethodCallHandler { } } - override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { + override fun onMethodCall(call: MethodCall, result: Result) { //no-op for compatibility } - override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { //no-op for compatibility } } diff --git a/example/lib/main_audio_widget.dart b/example/lib/main_audio_widget.dart index 67fff59d..483c7131 100644 --- a/example/lib/main_audio_widget.dart +++ b/example/lib/main_audio_widget.dart @@ -68,9 +68,8 @@ class _MyPageWithAudioState extends State { padding: const EdgeInsets.all(8.0), child: ElevatedButton( style: ElevatedButton.styleFrom( - shape: CircleBorder(), + shape: CircleBorder(), backgroundColor: Theme.of(context).primaryColor, padding: EdgeInsets.all(14), - primary: Theme.of(context).primaryColor, ), onPressed: () { setState(() { diff --git a/example/lib/main_local_file.dart b/example/lib/main_local_file.dart index 7c1c9592..187f28fc 100644 --- a/example/lib/main_local_file.dart +++ b/example/lib/main_local_file.dart @@ -65,7 +65,7 @@ class _MyHomePageState extends State { Icons.file_download, color: Colors.white, ), - style: ElevatedButton.styleFrom(primary: Colors.green), + style: ElevatedButton.styleFrom(backgroundColor: Colors.green), label: Text( 'Dowload', style: TextStyle(color: Colors.white), diff --git a/example/lib/main_record.dart b/example/lib/main_record.dart index a39b53a0..a96e73d7 100644 --- a/example/lib/main_record.dart +++ b/example/lib/main_record.dart @@ -93,7 +93,7 @@ class RecorderExampleState extends State { } }, style: TextButton.styleFrom( - primary: Colors.lightBlue, + foregroundColor: Colors.lightBlue, ), child: _buildText(_currentStatus), ), @@ -102,7 +102,7 @@ class RecorderExampleState extends State { onPressed: _currentStatus != RecordingStatus.Unset ? _stop : null, style: TextButton.styleFrom( - primary: Colors.blueAccent.withOpacity(0.5), + foregroundColor: Colors.blueAccent.withOpacity(0.5), ), child: Text('Stop', style: TextStyle(color: Colors.white)), ), @@ -112,7 +112,7 @@ class RecorderExampleState extends State { TextButton( onPressed: onPlayAudio, style: TextButton.styleFrom( - primary: Colors.blueAccent.withOpacity(0.5), + foregroundColor: Colors.blueAccent.withOpacity(0.5), ), child: Text('Play', style: TextStyle(color: Colors.white)), ), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 6047786a..b90d2477 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: "none" version: 3.0.0 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.19.0 <3.0.0" flutter: ">=2.0.0" dependencies: @@ -13,9 +13,9 @@ dependencies: flutter_neumorphic: ^3.2.0 rxdart: ^0.27.0 # for local file test - dio: ^4.0.0-beta7 + dio: ^5.2.1+1 path_provider: ^2.0.1 - http: ^0.13.0 + http: ^1.1.0 provider: ^6.0.0 file: ^6.1.0 #flutter_html: ^2.2.1 @@ -35,7 +35,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - build_web_compilers: ">=2.0.0 <3.0.0" + build_web_compilers: ^4.0.4 pedantic: ^1.11.0 # uncomment to use remote repos diff --git a/lib/src/playable.dart b/lib/src/playable.dart index 3504e303..4626d8d1 100644 --- a/lib/src/playable.dart +++ b/lib/src/playable.dart @@ -1,5 +1,4 @@ import 'dart:convert'; -import 'dart:typed_data'; import 'package:assets_audio_player/assets_audio_player.dart'; import 'package:flutter/foundation.dart'; @@ -224,8 +223,8 @@ class Audio extends Playable { required this.audioType, this.package, this.cached, - this.playSpeed, this.pitch, + this.playSpeed, Map? headers, Metas? metas, this.drmConfiguration diff --git a/pubspec.yaml b/pubspec.yaml index dfabbd69..aec4afda 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ version: 3.0.6 homepage: https://github.com/florent37/Flutter-AssetsAudioPlayer environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.19.0 <3.0.0" flutter: ">=2.0.0" dependencies: @@ -14,7 +14,7 @@ dependencies: sdk: flutter rxdart: ^0.27.3 uuid: ^3.0.5 - http: ^0.13.4 # to download / cache network files + http: ^1.1.0 # to download / cache network files path_provider: ^2.0.8 # removed this because it cancel flutter/android/ios on pub.dev path_provider: ^1.6.10 # The design on https://flutter.dev/go/federated-plugins was to leave