├── .gitignore
├── .idea
├── libraries
│ └── Dart_SDK.xml
├── modules.xml
├── runConfigurations
│ └── example_lib_main_dart.xml
└── workspace.xml
├── .metadata
├── 1.png
├── 2.png
├── 3.png
├── CHANGELOG.md
├── LICENSE
├── README.md
├── acr_cloud_sdk.iml
├── analysis_options.yaml
├── android
├── .gitignore
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── libs
│ ├── acrcloud-universal-sdk-1.2.20.jar
│ ├── arm64-v8a
│ │ └── libACRCloudUniversalEngine.so
│ ├── armeabi-v7a
│ │ └── libACRCloudUniversalEngine.so
│ ├── armeabi
│ │ └── libACRCloudUniversalEngine.so
│ ├── mips
│ │ └── libACRCloudUniversalEngine.so
│ ├── mips64
│ │ └── libACRCloudUniversalEngine.so
│ ├── x86
│ │ └── libACRCloudUniversalEngine.so
│ └── x86_64
│ │ └── libACRCloudUniversalEngine.so
├── settings.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── kotlin
│ └── com
│ └── chizi
│ └── acr_cloud_sdk
│ ├── AcrCloudSdkPlugin.kt
│ └── MethodCallHandlerImpl.kt
├── codemagic.yaml
├── example
├── .gitignore
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── chizi
│ │ │ │ │ └── acr_cloud_sdk_example
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── assets
│ └── images
│ │ ├── more.png
│ │ └── music.png
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Podfile.lock
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
├── lib
│ ├── core
│ │ ├── models
│ │ │ └── deezer_song_model.dart
│ │ ├── network_layer
│ │ │ ├── api
│ │ │ │ └── song.dart
│ │ │ ├── base_network
│ │ │ │ └── base_network.dart
│ │ │ ├── base_repository.dart
│ │ │ ├── exceptions
│ │ │ │ └── exceptions.dart
│ │ │ ├── failure
│ │ │ │ └── failure.dart
│ │ │ ├── helper
│ │ │ │ └── api_helper.dart
│ │ │ └── network
│ │ │ │ └── network_info.dart
│ │ ├── providers.dart
│ │ └── viewmodel
│ │ │ └── home_vm.dart
│ ├── main.dart
│ ├── utils
│ │ ├── log.dart
│ │ ├── margin.dart
│ │ ├── navigator.dart
│ │ ├── pretty_json.dart
│ │ └── theme.dart
│ └── views
│ │ ├── home_page.dart
│ │ └── song_detail.dart
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Podfile
│ ├── Podfile.lock
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ └── MainMenu.xib
│ │ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
├── pubspec.lock
├── pubspec.yaml
└── test
│ └── widget_test.dart
├── ios
├── .gitignore
├── Assets
│ └── .gitkeep
├── Classes
│ ├── ACRCloudConfig.h
│ ├── ACRCloudRecognition.h
│ ├── AcrCloudSdkPlugin.h
│ ├── AcrCloudSdkPlugin.m
│ └── SwiftAcrCloudSdkPlugin.swift
├── Libraries
│ └── libACRCloud_IOS_SDK.a
└── acr_cloud_sdk.podspec
├── lib
├── acr_cloud_sdk.dart
└── src
│ ├── acr_cloud.dart
│ └── models
│ └── song_model.dart
├── macos
├── Classes
│ ├── ACRCloudConfig.h
│ ├── ACRCloudRecognition.h
│ ├── AcrCloudSdkPlugin.h
│ ├── AcrCloudSdkPlugin.m
│ └── SwiftAcrCloudSdkPlugin.swift
├── Libraries
│ └── libACRCloud_IOS_SDK.a
└── acr_cloud_sdk.podspec
├── pubspec.lock
├── pubspec.yaml
└── test
└── acr_cloud_sdk_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/example_lib_main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: a0860f6e87ba4f9031bee4d6f56c08b970606bee
8 | channel: dev
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/1.png
--------------------------------------------------------------------------------
/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/2.png
--------------------------------------------------------------------------------
/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/3.png
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 2.0.2
2 | * Update sdk to >=2.19.2 <3.0.0
3 |
4 | ## 2.0.1
5 | * Update deps.
6 |
7 | ## 2.0.0
8 | * Migrated to null-saftey.
9 |
10 | ## 1.0.0
11 | * Initial release.
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Chiziaruhoma Ogbonda
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ACR Cloud SDK
2 | `** This is an unofficial SDK for flutter`
3 |
4 | Automatic content recognition (ACR) is an identification technology to recognise content played on a media device or present in a media file. This enables users quickly obtain detailed information about the content they have just experienced without any text based input or search efforts.
5 |
6 |
7 |
8 | ## 🤔 How ACR works
9 | ACR can help users deal with multimedia more effective and make applications more intelligent. [More info](https://docs.acrcloud.com/tutorials/recognize-music).
10 |
11 |
12 | ## 📸 Screen Shots
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ### 🚀 Initialize SDK
21 |
22 | ```dart
23 | final AcrCloudSdk arc = AcrCloudSdk();
24 |
25 | arc..init(
26 | host: '', // obtain from https://www.acrcloud.com/
27 | accessKey: '', // obtain from https://www.acrcloud.com/
28 | accessSecret: '', // obtain from https://www.acrcloud.com/
29 | setLog: false,
30 | )..songModelStream.listen(searchSong);
31 |
32 | void searchSong(SongModel song) async {
33 | print(song); // Recognized song data
34 | }
35 | ```
36 |
37 | Initialize sdk and listen for song recognition events.
38 |
39 | ### ️🎶 Start Recognition
40 |
41 | ```dart
42 | bool started = await arc.start();
43 | ```
44 | - This function will automatic start the recording and recognizing process.
45 | - When there’s a result, songModelStream & resultStream will return the data as events.
46 | - The whole recognition time is controlled by ACRCloud’s Server.
47 | - You can call the stop function to terminate this process.
48 |
49 | ### ⛔ Stop Recognition
50 |
51 | ```dart
52 | bool started = await arc.stop();
53 | ```
54 | - This function will cancel the recognition immediately.
55 |
56 |
57 | ## ✨ Contribution
58 | Lots of PR's would be needed to improve this plugin. So lots of suggestions and PRs are welcome.
59 |
--------------------------------------------------------------------------------
/acr_cloud_sdk.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:lints/recommended.yaml
2 |
3 |
4 | analyzer:
5 | exclude:
6 | - flutter/*
7 | - example/**
8 |
9 | # Additional information about this file can be found at
10 | # https://dart.dev/guides/language/analysis-options
11 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.chizi.acr_cloud_sdk'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | ext.kotlin_version = '1.7.10'
6 | repositories {
7 | google()
8 | mavenCentral()
9 | }
10 |
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:7.2.0'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | mavenCentral()
21 | }
22 | }
23 |
24 | apply plugin: 'com.android.library'
25 | apply plugin: 'kotlin-android'
26 |
27 | android {
28 | compileSdkVersion 31
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = '1.8'
37 | }
38 |
39 | sourceSets {
40 | main.java.srcDirs += 'src/main/kotlin'
41 | main.jniLibs.srcDirs = ['libs']
42 | }
43 |
44 | defaultConfig {
45 | minSdkVersion 16
46 | }
47 |
48 | buildTypes {
49 | release {
50 | minifyEnabled false
51 | }
52 | }
53 | lintOptions {
54 | disable 'InvalidPackage'
55 | }
56 | }
57 |
58 | dependencies {
59 | implementation fileTree(include: ['*.jar'], dir: 'libs')
60 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
61 | }
62 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
6 |
--------------------------------------------------------------------------------
/android/libs/acrcloud-universal-sdk-1.2.20.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/acrcloud-universal-sdk-1.2.20.jar
--------------------------------------------------------------------------------
/android/libs/arm64-v8a/libACRCloudUniversalEngine.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/arm64-v8a/libACRCloudUniversalEngine.so
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/libACRCloudUniversalEngine.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/armeabi-v7a/libACRCloudUniversalEngine.so
--------------------------------------------------------------------------------
/android/libs/armeabi/libACRCloudUniversalEngine.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/armeabi/libACRCloudUniversalEngine.so
--------------------------------------------------------------------------------
/android/libs/mips/libACRCloudUniversalEngine.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/mips/libACRCloudUniversalEngine.so
--------------------------------------------------------------------------------
/android/libs/mips64/libACRCloudUniversalEngine.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/mips64/libACRCloudUniversalEngine.so
--------------------------------------------------------------------------------
/android/libs/x86/libACRCloudUniversalEngine.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/x86/libACRCloudUniversalEngine.so
--------------------------------------------------------------------------------
/android/libs/x86_64/libACRCloudUniversalEngine.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/android/libs/x86_64/libACRCloudUniversalEngine.so
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'acr_cloud_sdk'
2 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/chizi/acr_cloud_sdk/AcrCloudSdkPlugin.kt:
--------------------------------------------------------------------------------
1 | package com.chizi.acr_cloud_sdk
2 |
3 | import androidx.annotation.NonNull
4 | import io.flutter.embedding.engine.plugins.FlutterPlugin
5 | import io.flutter.embedding.engine.plugins.activity.ActivityAware
6 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
7 | import io.flutter.plugin.common.EventChannel
8 | import io.flutter.plugin.common.MethodChannel
9 |
10 |
11 | /** AcrCloudSdkPlugin */
12 | class AcrCloudSdkPlugin: FlutterPlugin, ActivityAware {
13 |
14 | private var channel: MethodChannel? = null
15 | private var resultChannel: EventChannel? = null
16 | private var timeChannel: EventChannel? = null
17 | private val channelID = "plugins.chizi.tech/acr_cloud_sdk"
18 | private val resultChannelID = "plugins.chizi.tech/acr_cloud_sdk.result"
19 | private val timeChannelID = "plugins.chizi.tech/acr_cloud_sdk.time"
20 | private var handler: MethodCallHandlerImpl? = null
21 |
22 | override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
23 | setupChannel(flutterPluginBinding)
24 | }
25 |
26 | override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
27 | teardownChannel()
28 | }
29 |
30 | private fun setupChannel(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
31 | channel = MethodChannel(flutterPluginBinding.binaryMessenger, channelID)
32 | resultChannel = EventChannel(flutterPluginBinding.binaryMessenger, resultChannelID)
33 | timeChannel = EventChannel(flutterPluginBinding.binaryMessenger, timeChannelID)
34 | handler = MethodCallHandlerImpl(flutterPluginBinding.applicationContext, null, timeChannel,resultChannel, channel!!)
35 | channel?.setMethodCallHandler(handler)
36 | }
37 |
38 |
39 |
40 | override fun onAttachedToActivity(binding: ActivityPluginBinding) {
41 | handler?.setActivity(binding.activity)
42 | }
43 |
44 | override fun onDetachedFromActivityForConfigChanges() {
45 | handler?.setActivity(null)
46 | }
47 |
48 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
49 | onAttachedToActivity(binding)
50 | }
51 |
52 | override fun onDetachedFromActivity() {
53 | // onDetachedFromActivity()
54 | }
55 |
56 | private fun teardownChannel() {
57 | channel?.setMethodCallHandler(null)
58 | channel = null
59 | handler = null
60 | }
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/chizi/acr_cloud_sdk/MethodCallHandlerImpl.kt:
--------------------------------------------------------------------------------
1 | package com.chizi.acr_cloud_sdk
2 |
3 |
4 | import android.Manifest
5 | import android.app.Activity
6 | import android.content.Context
7 | import android.content.pm.PackageManager
8 | import android.media.MediaPlayer
9 | import android.os.Handler
10 | import android.os.Looper
11 | import android.widget.TextView
12 | import androidx.core.app.ActivityCompat
13 | import com.acrcloud.rec.*
14 | import com.acrcloud.rec.utils.ACRCloudLogger
15 | import io.flutter.plugin.common.EventChannel
16 | import io.flutter.plugin.common.MethodCall
17 | import io.flutter.plugin.common.MethodChannel
18 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler
19 | import java.util.*
20 |
21 |
22 | internal class MethodCallHandlerImpl(context: Context, activity: Activity?, timeChannel: EventChannel?, resultChannel: EventChannel?, methodChannel: MethodChannel) : MethodCallHandler, IACRCloudListener, IACRCloudRadioMetadataListener, EventChannel.StreamHandler {
23 |
24 | private var context: Context?
25 | private var activity: Activity?
26 | private var timeChannel: EventChannel?
27 | private var resultChannel: EventChannel?
28 | private var methodChannel: MethodChannel?
29 |
30 | private val TAG: String = "acr_cloud_sdk"
31 |
32 |
33 | private var mProcessing = false
34 | private var mAutoRecognizing = false
35 | private var initState = false
36 |
37 | private val mediaPlayer = MediaPlayer()
38 |
39 | private var timeEvents: EventChannel.EventSink? = null
40 | private var resultEvents: EventChannel.EventSink? = null
41 |
42 | private val path = ""
43 |
44 | private var startTime: Long = 0
45 | private val stopTime: Long = 0
46 |
47 | private val PRINT_MSG = 1001
48 |
49 | private var mConfig: ACRCloudConfig? = null
50 | private var mClient: ACRCloudClient? = null
51 |
52 | fun setActivity(act: Activity?) {
53 | this.activity = act
54 | }
55 |
56 | init {
57 | this.activity = activity
58 | this.context = context
59 | this.resultChannel = resultChannel
60 | this.timeChannel = timeChannel
61 | this.methodChannel = methodChannel
62 | timeChannel?.setStreamHandler(this)
63 | resultChannel?.setStreamHandler(this)
64 |
65 | }
66 |
67 | override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
68 | Handler(Looper.getMainLooper()).post {
69 | when (call.method) {
70 | "init" -> {
71 | init(call, result)
72 | }
73 | "start" -> {
74 | start(call,result)
75 | }
76 | "cancel" -> {
77 | cancel(result)
78 | }
79 | else -> {
80 | result.notImplemented()
81 | }
82 | }
83 |
84 | }
85 | }
86 |
87 | private fun init(call: MethodCall, result: MethodChannel.Result) {
88 |
89 | val host = call.argument("host")
90 | val accessKey = call.argument("accessKey")
91 | val accessSecret = call.argument("accessSecret")
92 |
93 |
94 | val hostAuto = call.argument("hostAuto")
95 | val accessKeyAuto = call.argument("accessKeyAuto")
96 | val accessSecretAuto = call.argument("accessSecretAuto")
97 |
98 | val recorderConfigRate = call.argument("recorderConfigRate") ?: 8000
99 | val recorderConfigChannels= call.argument("recorderConfigChannels") ?: 1
100 | val isVolumeCallback = call.argument("isVolumeCallback")?: false
101 | val setLog = call.argument("setLog") ?: false
102 |
103 | try {
104 |
105 | verifyPermissions()
106 |
107 | mConfig = ACRCloudConfig()
108 |
109 | mConfig!!.acrcloudListener = this
110 | mConfig!!.context = context
111 |
112 |
113 |
114 | mConfig!!.host = host
115 | mConfig!!.accessKey = accessKey
116 | mConfig!!.accessSecret = accessSecret
117 |
118 | // auto recognize access key
119 |
120 | mConfig!!.hostAuto = hostAuto
121 | mConfig!!.accessKeyAuto = accessKeyAuto
122 | mConfig!!.accessSecretAuto = accessSecretAuto
123 |
124 |
125 | mConfig!!.recorderConfig.rate = recorderConfigRate
126 | mConfig!!.recorderConfig.channels = recorderConfigChannels
127 |
128 | // If you do not need volume callback, you set it false.
129 |
130 | mConfig!!.recorderConfig.isVolumeCallback = isVolumeCallback
131 |
132 | mClient = ACRCloudClient()
133 | ACRCloudLogger.setLog(setLog)
134 |
135 | initState = mClient!!.initWithConfig(mConfig)
136 |
137 | } catch (e: Exception){
138 | result.error(TAG, null, e.toString())
139 | }
140 |
141 | }
142 |
143 |
144 |
145 |
146 | private fun start(call: MethodCall, result: MethodChannel.Result) {
147 | val autoRecognize = call.argument("autoRecognize")?: false
148 | val requestRadioMeta = call.argument("requestRadioMetadata")?: false
149 |
150 | if(requestRadioMeta) requestRadioMetadata()
151 |
152 | if (autoRecognize) {
153 | openAutoRecognize(result)
154 | } else {
155 | closeAutoRecognize(result)
156 | }
157 |
158 | if (!initState) {
159 | result.error(TAG, "init error", "please initialize plugin with .init()")
160 | return
161 | }
162 | if (!mProcessing) {
163 | mProcessing = true
164 | if (mClient == null || !mClient!!.startRecognize()) {
165 | mProcessing = false
166 |
167 | result.error(TAG, "start error!", "Could not start the service")
168 | }
169 | startTime = System.currentTimeMillis()
170 | }
171 | }
172 |
173 | private fun cancel(result: MethodChannel.Result) {
174 | if (mProcessing && mClient != null) {
175 | mClient!!.cancel()
176 | }
177 | reset()
178 | result.success(true)
179 | }
180 |
181 | private fun openAutoRecognize(result: MethodChannel.Result) {
182 | if (!mAutoRecognizing) {
183 | mAutoRecognizing = true
184 | if (mClient == null || !mClient!!.runAutoRecognize()) {
185 | mAutoRecognizing = true
186 | result.error(TAG, "openAutoRecognize error!", "Could not openAutoRecognize")
187 |
188 | }
189 | }
190 | }
191 |
192 | private fun closeAutoRecognize(result: MethodChannel.Result) {
193 | if (mAutoRecognizing) {
194 | mAutoRecognizing = false
195 | mClient!!.cancelAutoRecognize()
196 | result.error(TAG, "closeAutoRecognize error!", "Could not closeAutoRecognize")
197 |
198 | }
199 | }
200 |
201 | // callback IACRCloudRadioMetadataListener
202 | private fun requestRadioMetadata() {
203 | val lat = "39.98"
204 | val lng = "116.29"
205 | val freq: MutableList = ArrayList()
206 | freq.add("88.7")
207 | if (!mClient!!.requestRadioMetadataAsyn(lat, lng, freq,
208 | ACRCloudConfig.RadioType.FM, this)) {
209 | println("requestRadioMetadata error")
210 | }
211 | }
212 |
213 | private fun reset() {
214 | mProcessing = false
215 | }
216 |
217 | private val REQUEST_EXTERNAL_STORAGE = 1
218 | private val PERMISSIONS = arrayOf(
219 | Manifest.permission.ACCESS_NETWORK_STATE,
220 | Manifest.permission.ACCESS_WIFI_STATE,
221 | Manifest.permission.INTERNET,
222 | Manifest.permission.RECORD_AUDIO
223 | )
224 |
225 | private fun verifyPermissions() {
226 | for (i in PERMISSIONS.indices) {
227 | val permission = activity?.let { ActivityCompat.checkSelfPermission(it, PERMISSIONS[i]) }
228 | if (permission != PackageManager.PERMISSION_GRANTED) {
229 | activity?.let {
230 | ActivityCompat.requestPermissions(it, PERMISSIONS,
231 | REQUEST_EXTERNAL_STORAGE)
232 | }
233 | break
234 | }
235 | }
236 | }
237 |
238 |
239 |
240 | override fun onResult(results: ACRCloudResult?) {
241 | this.reset()
242 |
243 | // If you want to save the record audio data, you can refer to the following codes.
244 | /*
245 | byte[] recordPcm = results.getRecordDataPCM();
246 | if (recordPcm != null) {
247 | byte[] recordWav = ACRCloudUtils.pcm2Wav(recordPcm, this.mConfig.recorderConfig.rate, this.mConfig.recorderConfig.channels);
248 | ACRCloudUtils.createFileWithByte(recordWav, path + "/" + "record.wav");
249 | }
250 | */
251 | val result: String = results!!.result
252 | resultEvents?.success(result)
253 | }
254 |
255 | override fun onVolumeChanged(p0: Double) {
256 | val time = (System.currentTimeMillis() - startTime) / 1000
257 | timeEvents?.success(time.toDouble())
258 |
259 | }
260 |
261 |
262 | override fun onRadioMetadataResult(result: String?) {
263 | resultEvents?.success(result)
264 | }
265 |
266 | override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
267 | when (arguments) {
268 | 0 -> {
269 | this.timeEvents = events
270 | }
271 | 1 -> {
272 | this.resultEvents = events
273 | }
274 | else -> {
275 | }
276 | }
277 | }
278 |
279 | override fun onCancel(arguments: Any?) {
280 | if (mProcessing && mClient != null) {
281 | mClient!!.release()
282 | mClient!!.cancel()
283 | }
284 | reset()
285 | }
286 | }
287 |
--------------------------------------------------------------------------------
/codemagic.yaml:
--------------------------------------------------------------------------------
1 | # Check out https://docs.codemagic.io/getting-started/yaml/ for more information
2 |
3 | workflows:
4 | flutter-package:
5 | name: Flutter or Dart Package
6 | environment:
7 | flutter: dev
8 | scripts:
9 | - flutter packages pub get
10 | - flutter test
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: a0860f6e87ba4f9031bee4d6f56c08b970606bee
8 | channel: dev
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 0.0.1
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/example/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # acr_cloud_sdk_example
2 |
3 | Demonstrates how to use the acr_cloud_sdk plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 29
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.chizi.acr_cloud_sdk_example"
42 | minSdkVersion 16
43 | targetSdkVersion 29
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
13 |
17 |
21 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/chizi/acr_cloud_sdk_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.chizi.acr_cloud_sdk_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/example/assets/images/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/assets/images/more.png
--------------------------------------------------------------------------------
/example/assets/images/music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/assets/images/music.png
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - acr_cloud_sdk (0.0.1):
3 | - Flutter
4 | - Flutter (1.0.0)
5 | - path_provider (0.0.1):
6 | - Flutter
7 | - "permission_handler (5.0.1+1)":
8 | - Flutter
9 |
10 | DEPENDENCIES:
11 | - acr_cloud_sdk (from `.symlinks/plugins/acr_cloud_sdk/ios`)
12 | - Flutter (from `Flutter`)
13 | - path_provider (from `.symlinks/plugins/path_provider/ios`)
14 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`)
15 |
16 | EXTERNAL SOURCES:
17 | acr_cloud_sdk:
18 | :path: ".symlinks/plugins/acr_cloud_sdk/ios"
19 | Flutter:
20 | :path: Flutter
21 | path_provider:
22 | :path: ".symlinks/plugins/path_provider/ios"
23 | permission_handler:
24 | :path: ".symlinks/plugins/permission_handler/ios"
25 |
26 | SPEC CHECKSUMS:
27 | acr_cloud_sdk: be534d6a9db53b00a541c7ce31bbb414e2485305
28 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
29 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
30 | permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
31 |
32 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
33 |
34 | COCOAPODS: 1.10.0
35 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zfinix/acr_cloud_sdk/f75c17fc94b70afbe06d046b419afb84ded09859/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | acr_cloud_sdk_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | UIViewControllerBasedStatusBarAppearance
47 |
48 | NSMicrophoneUsageDescription
49 | Need your microphone
50 |
51 |
52 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/lib/core/models/deezer_song_model.dart:
--------------------------------------------------------------------------------
1 | class DeezerSongModel {
2 | int? id;
3 | bool? readable;
4 | String? title;
5 | String? titleShort;
6 | String? titleVersion;
7 | String? isrc;
8 | String? link;
9 | String? share;
10 | num? duration;
11 | num? trackPosition;
12 | num? diskNumber;
13 | num? rank;
14 | String? releaseDate;
15 | bool? explicitLyrics;
16 | int? explicitContentLyrics;
17 | int? explicitContentCover;
18 | String? preview;
19 | num? bpm;
20 | num? gain;
21 | List? availableCountries;
22 | List? contributors;
23 | String? md5Image;
24 | Artist? artist;
25 | Album? album;
26 | String? type;
27 |
28 | DeezerSongModel({
29 | this.id,
30 | this.readable,
31 | this.title,
32 | this.titleShort,
33 | this.titleVersion,
34 | this.isrc,
35 | this.link,
36 | this.share,
37 | this.duration,
38 | this.trackPosition,
39 | this.diskNumber,
40 | this.rank,
41 | this.releaseDate,
42 | this.explicitLyrics,
43 | this.explicitContentLyrics,
44 | this.explicitContentCover,
45 | this.preview,
46 | this.bpm,
47 | this.gain,
48 | this.availableCountries,
49 | this.contributors,
50 | this.md5Image,
51 | this.artist,
52 | this.album,
53 | this.type,
54 | });
55 |
56 | DeezerSongModel.fromJson(Map json) {
57 | id = json['id'];
58 | readable = json['readable'];
59 | title = json['title'];
60 | titleShort = json['title_short'];
61 | titleVersion = json['title_version'];
62 | isrc = json['isrc'];
63 | link = json['link'];
64 | share = json['share'];
65 | duration = json['duration'];
66 | trackPosition = json['track_position'];
67 | diskNumber = json['disk_number'];
68 | rank = json['rank'];
69 | releaseDate = json['release_date'];
70 | explicitLyrics = json['explicit_lyrics'];
71 | explicitContentLyrics = json['explicit_content_lyrics'];
72 | explicitContentCover = json['explicit_content_cover'];
73 | preview = json['preview'];
74 | bpm = json['bpm'];
75 | gain = json['gain'];
76 | availableCountries = json['available_countries'].cast();
77 | if (json['contributors'] != null) {
78 | contributors = [];
79 | json['contributors'].forEach((v) {
80 | contributors?.add(new Contributors.fromJson(v));
81 | });
82 | }
83 | md5Image = json['md5_image'];
84 | artist =
85 | json['artist'] != null ? new Artist.fromJson(json['artist']) : null;
86 | album = json['album'] != null ? new Album.fromJson(json['album']) : null;
87 | type = json['type'];
88 | }
89 |
90 | Map toJson() {
91 | final Map data = new Map();
92 | data['id'] = this.id;
93 | data['readable'] = this.readable;
94 | data['title'] = this.title;
95 | data['title_short'] = this.titleShort;
96 | data['title_version'] = this.titleVersion;
97 | data['isrc'] = this.isrc;
98 | data['link'] = this.link;
99 | data['share'] = this.share;
100 | data['duration'] = this.duration;
101 | data['track_position'] = this.trackPosition;
102 | data['disk_number'] = this.diskNumber;
103 | data['rank'] = this.rank;
104 | data['release_date'] = this.releaseDate;
105 | data['explicit_lyrics'] = this.explicitLyrics;
106 | data['explicit_content_lyrics'] = this.explicitContentLyrics;
107 | data['explicit_content_cover'] = this.explicitContentCover;
108 | data['preview'] = this.preview;
109 | data['bpm'] = this.bpm;
110 | data['gain'] = this.gain;
111 | data['available_countries'] = this.availableCountries;
112 | if (this.contributors != null) {
113 | data['contributors'] = this.contributors?.map((v) => v.toJson()).toList();
114 | }
115 | data['md5_image'] = this.md5Image;
116 | if (this.artist != null) {
117 | data['artist'] = this.artist?.toJson();
118 | }
119 | if (this.album != null) {
120 | data['album'] = this.album?.toJson();
121 | }
122 | data['type'] = this.type;
123 | return data;
124 | }
125 | }
126 |
127 | class Contributors {
128 | int? id;
129 | String? name;
130 | String? link;
131 | String? share;
132 | String? picture;
133 | String? pictureSmall;
134 | String? pictureMedium;
135 | String? pictureBig;
136 | String? pictureXl;
137 | bool? radio;
138 | String? tracklist;
139 | String? type;
140 | String? role;
141 |
142 | Contributors(
143 | {this.id,
144 | this.name,
145 | this.link,
146 | this.share,
147 | this.picture,
148 | this.pictureSmall,
149 | this.pictureMedium,
150 | this.pictureBig,
151 | this.pictureXl,
152 | this.radio,
153 | this.tracklist,
154 | this.type,
155 | this.role});
156 |
157 | Contributors.fromJson(Map json) {
158 | id = json['id'];
159 | name = json['name'];
160 | link = json['link'];
161 | share = json['share'];
162 | picture = json['picture'];
163 | pictureSmall = json['picture_small'];
164 | pictureMedium = json['picture_medium'];
165 | pictureBig = json['picture_big'];
166 | pictureXl = json['picture_xl'];
167 | radio = json['radio'];
168 | tracklist = json['tracklist'];
169 | type = json['type'];
170 | role = json['role'];
171 | }
172 |
173 | Map toJson() {
174 | final Map data = new Map();
175 | data['id'] = this.id;
176 | data['name'] = this.name;
177 | data['link'] = this.link;
178 | data['share'] = this.share;
179 | data['picture'] = this.picture;
180 | data['picture_small'] = this.pictureSmall;
181 | data['picture_medium'] = this.pictureMedium;
182 | data['picture_big'] = this.pictureBig;
183 | data['picture_xl'] = this.pictureXl;
184 | data['radio'] = this.radio;
185 | data['tracklist'] = this.tracklist;
186 | data['type'] = this.type;
187 | data['role'] = this.role;
188 | return data;
189 | }
190 | }
191 |
192 | class Artist {
193 | int? id;
194 | String? name;
195 | String? link;
196 | String? share;
197 | String? picture;
198 | String? pictureSmall;
199 | String? pictureMedium;
200 | String? pictureBig;
201 | String? pictureXl;
202 | bool? radio;
203 | String? tracklist;
204 | String? type;
205 |
206 | Artist(
207 | {this.id,
208 | this.name,
209 | this.link,
210 | this.share,
211 | this.picture,
212 | this.pictureSmall,
213 | this.pictureMedium,
214 | this.pictureBig,
215 | this.pictureXl,
216 | this.radio,
217 | this.tracklist,
218 | this.type});
219 |
220 | Artist.fromJson(Map json) {
221 | id = json['id'];
222 | name = json['name'];
223 | link = json['link'];
224 | share = json['share'];
225 | picture = json['picture'];
226 | pictureSmall = json['picture_small'];
227 | pictureMedium = json['picture_medium'];
228 | pictureBig = json['picture_big'];
229 | pictureXl = json['picture_xl'];
230 | radio = json['radio'];
231 | tracklist = json['tracklist'];
232 | type = json['type'];
233 | }
234 |
235 | Map toJson() {
236 | final Map data = new Map();
237 | data['id'] = this.id;
238 | data['name'] = this.name;
239 | data['link'] = this.link;
240 | data['share'] = this.share;
241 | data['picture'] = this.picture;
242 | data['picture_small'] = this.pictureSmall;
243 | data['picture_medium'] = this.pictureMedium;
244 | data['picture_big'] = this.pictureBig;
245 | data['picture_xl'] = this.pictureXl;
246 | data['radio'] = this.radio;
247 | data['tracklist'] = this.tracklist;
248 | data['type'] = this.type;
249 | return data;
250 | }
251 | }
252 |
253 | class Album {
254 | int? id;
255 | String? title;
256 | String? link;
257 | String? cover;
258 | String? coverSmall;
259 | String? coverMedium;
260 | String? coverBig;
261 | String? coverXl;
262 | String? md5Image;
263 | String? releaseDate;
264 | String? tracklist;
265 | String? type;
266 |
267 | Album(
268 | {this.id,
269 | this.title,
270 | this.link,
271 | this.cover,
272 | this.coverSmall,
273 | this.coverMedium,
274 | this.coverBig,
275 | this.coverXl,
276 | this.md5Image,
277 | this.releaseDate,
278 | this.tracklist,
279 | this.type});
280 |
281 | Album.fromJson(Map json) {
282 | id = json['id'];
283 | title = json['title'];
284 | link = json['link'];
285 | cover = json['cover'];
286 | coverSmall = json['cover_small'];
287 | coverMedium = json['cover_medium'];
288 | coverBig = json['cover_big'];
289 | coverXl = json['cover_xl'];
290 | md5Image = json['md5_image'];
291 | releaseDate = json['release_date'];
292 | tracklist = json['tracklist'];
293 | type = json['type'];
294 | }
295 |
296 | Map toJson() {
297 | final Map data = new Map();
298 | data['id'] = this.id;
299 | data['title'] = this.title;
300 | data['link'] = this.link;
301 | data['cover'] = this.cover;
302 | data['cover_small'] = this.coverSmall;
303 | data['cover_medium'] = this.coverMedium;
304 | data['cover_big'] = this.coverBig;
305 | data['cover_xl'] = this.coverXl;
306 | data['md5_image'] = this.md5Image;
307 | data['release_date'] = this.releaseDate;
308 | data['tracklist'] = this.tracklist;
309 | data['type'] = this.type;
310 | return data;
311 | }
312 | }
313 |
--------------------------------------------------------------------------------
/example/lib/core/network_layer/api/song.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:acr_cloud_sdk_example/core/models/deezer_song_model.dart';
4 | import 'package:acr_cloud_sdk_example/core/network_layer/failure/failure.dart';
5 | import 'package:acr_cloud_sdk_example/core/network_layer/helper/api_helper.dart';
6 | import 'package:dartz/dartz.dart' show Either, Right, Left;
7 |
8 | import '../base_repository.dart';
9 |
10 | class SongAPI extends BaseRepository {
11 | final apiHelper = ApiHelper();
12 |
13 | Future> dataFromDeezer(String? id) async {
14 | return _dataFromDeezer(id);
15 | }
16 |
17 | Future> _dataFromDeezer(String? id) async {
18 | try {
19 | var headers = {
20 | 'Content-type': 'application/json;charset=UTF-8',
21 | 'Accept': 'application/json;charset=UTF-8',
22 | };
23 | final response = await apiHelper.get(
24 | url: 'https://api.deezer.com/track/$id',
25 | headers: headers,
26 | );
27 |
28 | if (response.contains('title'))
29 | return Right(DeezerSongModel.fromJson(json.decode(response)));
30 | else
31 | return Left(ServerFailure(message: response));
32 | } catch (e) {
33 | return Left(ServerFailure(message: e.toString()));
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/example/lib/core/network_layer/base_network/base_network.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:dio/dio.dart';
4 |
5 | mixin BaseNetwork {
6 | final Dio client = Dio(
7 | BaseOptions(
8 | responseType: ResponseType.plain,
9 | ),
10 | );
11 |
12 | Future