我创建了一个新插件
flutter create --template plugin alfalfa
生成lib/alfalfa.dart包含
import 'dart:async';
import 'package:flutter/services.dart';
class Alfalfa {
static const MethodChannel _channel =
const MethodChannel('alfalfa');
//...
}
我想添加一个EventChannelJava 和 Objective-C 代码可以回调 Dart 代码。我不知道EventChannel应该叫什么名字。
final EventChannel _eventChannel =
const EventChannel("com.rollingfields.alfalfa/events");
或者
final EventChannel _eventChannel =
const EventChannel("alfalfa/events");
或者是其他东西?有约定吗?
如果更好的选择EventChannel是包含反向域的名称,我应该将生成的名称重命名MethodChannel为com.rollingfields.alfalfa吗?