From 5b1f1531cdbc281910d0a65f68023731cb286162 Mon Sep 17 00:00:00 2001 From: Jeremiah Oluwaseun Erinola Date: Sun, 16 Oct 2022 22:52:59 +0100 Subject: [PATCH 1/2] Upgrade from 1.3.50 to 1.7.10 --- assets_audio_player_web/android/build.gradle | 16 +++++++++------- .../AssetsAudioPlayerWebPlugin.kt | 8 +++++--- pubspec.yaml | 4 ++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/assets_audio_player_web/android/build.gradle b/assets_audio_player_web/android/build.gradle index 9a7cde3f..0256f02b 100644 --- a/assets_audio_player_web/android/build.gradle +++ b/assets_audio_player_web/android/build.gradle @@ -2,14 +2,14 @@ group 'com.github.florent37.assets_audio_player_web' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.7.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:3.5.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -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.1.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/pubspec.yaml b/pubspec.yaml index b2341e84..785b7f10 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: assets_audio_player description: Play music/audio stored in assets files directly from Flutter & Network, Radio, LiveStream, Local files. Compatible with Android, iOS, web and macOS. -version: 3.0.5 +version: 3.0.6 #author: Florent Champigny homepage: https://github.com/florent37/Flutter-AssetsAudioPlayer @@ -23,7 +23,7 @@ dependencies: # TODO(amirh): Revisit this (either update this part in the design or the pub tool). # https://github.com/flutter/flutter/issues/46264 # assets_audio_player_web: ^3.0.0-nullsafety.0 - assets_audio_player_web: ^3.0.4+2 + assets_audio_player_web: ^3.0.5 dev_dependencies: flutter_test: From 077337ec24203b17e637b31b1714a684f1973ef9 Mon Sep 17 00:00:00 2001 From: Jeremiah Oluwaseun Erinola <53568423+jeremiahseun@users.noreply.github.com> Date: Fri, 30 Jun 2023 11:53:36 +0100 Subject: [PATCH 2/2] Upgrade audio package --- example/lib/main_audio_widget.dart | 3 +-- example/lib/main_local_file.dart | 2 +- example/lib/main_record.dart | 6 +++--- example/pubspec.yaml | 8 ++++---- lib/src/playable.dart | 3 +-- pubspec.yaml | 6 +++--- 6 files changed, 13 insertions(+), 15 deletions(-) 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 785b7f10..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 @@ -23,7 +23,7 @@ dependencies: # TODO(amirh): Revisit this (either update this part in the design or the pub tool). # https://github.com/flutter/flutter/issues/46264 # assets_audio_player_web: ^3.0.0-nullsafety.0 - assets_audio_player_web: ^3.0.5 + assets_audio_player_web: ^3.0.6 dev_dependencies: flutter_test: