/
Displaying A Player - Flutter

Displaying A Player - Flutter

Setup

To gain access to the AdPlayer APIs, first obtain an instance of the AdPlayerFlutterPlugin:

import 'package:adplayer_flutter_plugin/adplayer_flutter_plugin.dart'; class _MyScreenState extends State<MyScreen> { final _adPlayerFlutterPlugin = AdPlayerFlutterPlugin(); }

Then initialize the AdPlayer SDK:

@override void initState() { super.initState(); await _adPlayerFlutterPlugin.initAdPlayerSdk(publisherId, tagId); }

Display

To display a player just present an AdPlayerPlacementWidget as part of your UI:

import 'package:adplayer_flutter_plugin/adPlayerPlacement.dart'; @override Widget build(BuildContext context) { return AdPlayerPlacementWidget(tagId: tagId); }

Make sure the value of tagId is the same one that is being passed to initAdPlayerSdk.

Related content

Getting Started - Flutter
Getting Started - Flutter
More like this
InAppSDK
InAppSDK
More like this
Displaying a Player - UIKit
Displaying a Player - UIKit
More like this
Flutter
Flutter
More like this
Getting Started - iOS
Getting Started - iOS
Read with this
Displaying a Player - Android
Displaying a Player - Android
More like this