AdMelSdkPlatform class abstract
- Inheritance
-
- Object
- PlatformInterface
- AdMelSdkPlatform
- Implementers
Constructors
- AdMelSdkPlatform()
- Constructs a AdMelSdkPlatform.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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).
-
getCurrentPosition(
) → Future< double> - Get current audio position in seconds.
-
getCurrentVolume(
) → Future< double> - Get current volume (0.0 to 1.0).
-
getDuration(
) → Future< double> - Get audio duration in seconds.
-
getProgress(
) → Future< double> - Get playback progress (0.0 to 1.0).
-
getUserId(
) → Future< String?> - Get the currently set user ID.
-
initialize(
String environment) → Future< void> - Initialize the SDK with environment name ('development' or 'production').
-
isAutoRefreshEnabled(
) → Future< bool> - Check if auto refresh is enabled.
-
isPlaying(
) → Future< bool> - Check if audio is currently playing.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → Future< void> - Pause audio playback.
-
resume(
) → Future< void> - Resume audio playback.
-
setAdEventHandler(
void handler(String event, Map< String, dynamic> ? data)) → void -
Set handler for ad lifecycle events from native SDK.
datacontains additional event parameters (e.g. banner coordinates for adCompleted). -
setAutoRefresh(
{required bool enabled, int interval = 30}) → Future< void> - Set auto refresh enabled/disabled with interval.
-
setMediaId(
String mediaId) → Future< void> - Set the media ID.
-
setUserId(
String userId) → Future< void> - Set the publisher's user ID for S2S callback identification.
-
setVolume(
double volume) → Future< void> - Set volume (0.0 to 1.0).
-
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.
-
stopAudioAndHideBanner(
) → Future< void> - Stop audio and hide banner.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ AdMelSdkPlatform
-
The default instance of AdMelSdkPlatform to use.
getter/setter pair