MethodChannelAdMelSdk class

An implementation of AdMelSdkPlatform that uses method channels.

Inheritance

Constructors

MethodChannelAdMelSdk()

Properties

hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getCoinImageUrl() Future<String?>
Get the coin image URL from server remote config. Returns null if server didn't specify a custom URL (use SDK default).
override
getCurrentPosition() Future<double>
Get current audio position in seconds.
override
getCurrentVolume() Future<double>
Get current volume (0.0 to 1.0).
override
getDuration() Future<double>
Get audio duration in seconds.
override
getProgress() Future<double>
Get playback progress (0.0 to 1.0).
override
getUserId() Future<String?>
Get the currently set user ID.
override
initialize(String environment) Future<void>
Initialize the SDK with environment name ('development' or 'production').
override
isAutoRefreshEnabled() Future<bool>
Check if auto refresh is enabled.
override
isPlaying() Future<bool>
Check if audio is currently playing.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<void>
Pause audio playback.
override
resume() Future<void>
Resume audio playback.
override
setAdEventHandler(void handler(String event, Map<String, dynamic>? data)) → void
Set handler for ad lifecycle events from native SDK. data contains additional event parameters (e.g. banner coordinates for adCompleted).
override
setAutoRefresh({required bool enabled, int interval = 30}) Future<void>
Set auto refresh enabled/disabled with interval.
override
setMediaId(String mediaId) Future<void>
Set the media ID.
override
setUserId(String userId) Future<void>
Set the publisher's user ID for S2S callback identification.
override
setVolume(double volume) Future<void>
Set volume (0.0 to 1.0).
override
showAd({required String slotId, String position = 'bottom-right', double offsetX = 0.0, double offsetY = 0.0}) Future<void>
Load and show an ad for the given slot ID.
override
stopAudioAndHideBanner() Future<void>
Stop audio and hide banner.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited