SubscriberWidget

class SubscriberWidget(topic: String, channel: FlutterAsyncChannel, controllerName: String, dataType: AbstractType) : KlutterPrinter

Example

import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:klutter_ui/klutter_ui.dart';
import 'package:hello/src/my_response_dataclass.dart';

const _stream = EventChannel('com.example.hello/stream/my_response_subscriber');

class MyResponseSubscriber extends Subscriber<MyResponse> {
const MyResponseSubscriber({
required Widget Function(MyResponse?) builder,
Key? key,
}) : super(
builder: builder,
channel: _stream,
topic: "my_response_subscriber",
key: key,
);

@override
MyResponse deserialize(String json) => json.toMyResponse;
}

Constructors

Link copied to clipboard
constructor(topic: String, channel: FlutterAsyncChannel, controllerName: String, dataType: AbstractType)

Functions

Link copied to clipboard
open override fun print(): String