flutter_broadcast_receiver 1.0.0+2 copy "flutter_broadcast_receiver: ^1.0.0+2" to clipboard
flutter_broadcast_receiver: ^1.0.0+2 copied to clipboard

Enables you to broadcast global events in your app. Helpful in cases where your modules/components need to know about a change happened somewhere in your app.

flutter_broadcast_receiver #

Enables you to broadcast events in your app.

Usage #

flutter_broadcast_receiver: ^1.0.0+2
import 'package:flutter_broadcast_receiver/flutter_broadcast_receiver.dart';

Param Usage #

  • CUSTOM_EVENT Param key that must match with publisher
  • message Returned data from publisher
  • <anyDataType> Data Type returned from publisher or Data Type send from publisher
  • argument data from publisher (can be any data type)
/// Subscription Example
BroadcastReceiver()
.subscribe<String> // Data Type returned from publisher
           ('CUSTOM_EVENT' ,(message) {
              print(me ssage);
            });

/// Publishing Event
BroadcastReceiver()
    .publish<String>('CUSTOM_EVENT', arguments: 'Hello Subscribers');

/// Unsubscription Example
BroadcastReceiver().unsubscribe<int>('CUSTOM_EVENT_2', handler: _handler);

/// Receiving Event
final _handler = (int code) => print('The Code is: $code');
BroadcastReceiver().subscribe<int>('CUSTOM_EVENT_2', _handler);
11
likes
140
pub points
84%
popularity

Publisher

verified publisherdwiky.my.id

Enables you to broadcast global events in your app. Helpful in cases where your modules/components need to know about a change happened somewhere in your app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on flutter_broadcast_receiver