Skip to content

Instantly share code, notes, and snippets.

@Cheersupzoo
Last active July 5, 2020 13:20
Show Gist options
  • Save Cheersupzoo/a7788bcb971f4480839cf9e83e8d8ddf to your computer and use it in GitHub Desktop.
Save Cheersupzoo/a7788bcb971f4480839cf9e83e8d8ddf to your computer and use it in GitHub Desktop.
class PlatformChannel {
/* _methodChannel เดิม */
// เพิ่ม
static const EventChannel _eventChannel = const EventChannel('sample.test.platform/number');
/* getStringReturnFromPlatform เดิม */
// เพิ่ม
/// EventChannel com.test.platform/number
Stream<int> get getTimerStream => _eventChannel.receiveBroadcastStream().map((dynamic event) => event as int);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment