ProApiClient class
This class gives full access to the completely new ProPresenter API available in 7.9+
This API uses basic HTTP clients. For normal commands, a standard request/response method
is employed, but the API also allows for "subscriptions" to certain events which will result
in a persistent HTTP connection that receives streamed JSON data in chunks
.
The generated code in ProApiGeneratedWrapper
wraps those commands and returns responses of the
correct type either Future<Map<String, dynamic>>
or Future<Uint8List>
when not using the
"subscription" methods or streamed responses when using the "subscription" methods.
This class further wraps those functions to make using those methods more convenient. In particular,
this class allows easy subscriptions, will maintain an internal state
object to track the
current state of the ProPresenter instance, and will reduce complexity when calling endpoints
that accept large blocks of data.
Constructors
- ProApiClient(ProSettings settings)
- Creates new ProApiClient instance.
Properties
- api → ProApiGeneratedWrapper
-
final
-
callbacks
↔ Map<
String, List< void Function(Event< >Object> event)> -
getter/setter pairinherited
-
eventStream
↔ StreamController<
Event< Object> > -
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings ↔ ProSettings
-
getter/setter pair
- state ↔ ProState
-
getter/setter pair
-
statusSubscriptions
↔ Set<
String> -
getter/setter pair
-
updateListeners
↔ Map<
String, StreamSubscription> -
getter/setter pair
Methods
-
emit(
String event, [Object? data]) → void -
emit will always emit twice... first, by the name of the event
submitted, and secondly, by the name of the special event 'all'
inherited
-
listen(
String event) → Stream< Event< Object> > -
listen to an event on this
EventEmitter
as a stream. A True value will be emitted whenever the event by this name is emitted.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on(
String event, void callback(Event< Object> event)) → EventObserver -
set a callback for events of this type.
inherited
-
subscribeAll(
{dynamic withoutSysTime = false, dynamic withoutVideoCountdown = false}) → Future< bool> - will automatically call subscribeMulti with all available endpoints except for the endpoints that require specific ids:
-
subscribeMulti(
List< String> subs) → Future<bool> - will subscribe to chunked updates using the /status endpoint.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited