Skip to content

Commit

Permalink
refactor(darwin): Rearrange code (#1585)
Browse files Browse the repository at this point in the history
# Description

Pick refactor code of #1549 

---------

Co-authored-by: Gabriel Terwesten <gabriel@terwesten.net>
  • Loading branch information
Gustl22 and blaugold authored Aug 1, 2023
1 parent f6bf126 commit 13639d1
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 149 deletions.
12 changes: 6 additions & 6 deletions packages/audioplayers/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)

SPEC REPOS:
trunk:
Expand All @@ -70,19 +70,19 @@ EXTERNAL SOURCES:
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/ios"
:path: ".symlinks/plugins/path_provider_foundation/darwin"

SPEC CHECKSUMS:
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
integration_test: 13825b8a9334a850581300559b8839134b124670
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
SDWebImage: e5cc87bf736e60f49592f307bdf9e157189298a3
SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down
8 changes: 4 additions & 4 deletions packages/audioplayers/example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ PODS:
DEPENDENCIES:
- audioplayers_darwin (from `Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)

EXTERNAL SOURCES:
audioplayers_darwin:
:path: Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos
FlutterMacOS:
:path: Flutter/ephemeral
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin

SPEC CHECKSUMS:
audioplayers_darwin: dcad41de4fbd0099cb3749f7ab3b0cb8f70b810c
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class SwiftAudioplayersDarwinPlugin: NSObject, FlutterPlugin {
try globalContext.apply()
} catch AudioPlayerError.warning(let warnMsg) {
globalEvents.onLog(message: warnMsg)
} catch {
} catch {
result(FlutterError(code: "DarwinAudioError", message: "Error configuring global audio session: \(error)", details: nil))
}
} else if method == "emitLog" {
Expand Down Expand Up @@ -333,19 +333,19 @@ class AudioPlayersStreamHandler: NSObject, FlutterStreamHandler {

func onCurrentPosition(millis: Int) {
if let eventSink = self.sink {
eventSink(["event": "audio.onCurrentPosition", "value": millis])
eventSink(["event": "audio.onCurrentPosition", "value": millis] as [String: Any])
}
}

func onDuration(millis: Int) {
if let eventSink = self.sink {
eventSink(["event": "audio.onDuration", "value": millis])
eventSink(["event": "audio.onDuration", "value": millis] as [String: Any])
}
}

func onPrepared(isPrepared: Bool) {
if let eventSink = self.sink {
eventSink(["event": "audio.onPrepared", "value": isPrepared])
eventSink(["event": "audio.onPrepared", "value": isPrepared] as [String: Any])
}
}

Expand Down
Loading

0 comments on commit 13639d1

Please sign in to comment.