rx_method_channel

Creator: coderz1093

Last updated:

0 purchases

rx_method_channel Image
rx_method_channel Images
Add to Cart

Description:

rx method channel

rx_method_channel #
Reactive (Rx) wrapper for method channel in Flutter.
How to Use? #

Add this dependency to pubspec.yaml
Make method channel using RxMethodChannel

import 'package:rx_method_channel/rx_method_channel.dart';

void main() async {
final channel = RxMethodChannel(channelName: "channelName");

// Observable
final observableSubsciption = channel.executeObservable(
methodName: "methodName",
arguments: {},
).listen((event) {

});
observableSubsciption.cancel();

// Completable
final completableOperation =
channel.executeCompletable(methodName: "methodName");
await completableOperation.valueOrCancellation().whenComplete(() {
print("Completed");
});


// Single
final singleOperation = channel.executeSingle(
methodName: "methodName",
arguments: {
"arg": "someArg",
},
);

final value = await singleOperation.valueOrCancellation();
print(value);
}

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.

Related Products

More From This Creator