Skip to content

Instantly share code, notes, and snippets.

@vreamer
Created August 26, 2020 08:05
Show Gist options
  • Save vreamer/d26afcd4fd69971bb697627537e88f92 to your computer and use it in GitHub Desktop.
Save vreamer/d26afcd4fd69971bb697627537e88f92 to your computer and use it in GitHub Desktop.
Configure method channel
import 'package:flutter/services.dart';
class FlutterMethodChannel {
static const channelName = 'channel'; // this channel name needs to match the one in Native method channel
MethodChannel methodChannel;
static final FlutterMethodChannel instance = FlutterMethodChannel._init();
FlutterMethodChannel._init();
void configureChannel() {
methodChannel = MethodChannel(channelName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment