setter 'featureFlag' 没有为类型 'JitsiMeetingOptions' 定义
The setter 'featureFlag' isn't defined for the type 'JitsiMeetingOptions'
我正在使用 jitsi meet 包进行 flutter 并且我已经按照包的文档 https://pub.dev/packages/jitsi_meet 键入了代码,但是应用程序中仍然存在一些错误。错误说
The setter 'featureFlag' isn't defined for the type 'JitsiMeetingOptions'.
Try importing the library that defines 'featureFlag', correcting the name to the name of an existing setter, or defining a setter or field named 'featureFlag'.
这是加入会议功能
joinMeeting() async {
print(code);
try {
FeatureFlag featureFlag = FeatureFlag();
featureFlag.welcomePageEnabled = false;
featureFlag.resolution = FeatureFlagVideoResolution.MD_RESOLUTION;
featureFlag.addPeopleEnabled = false;
featureFlag.calendarEnabled = false;
featureFlag.callIntegrationEnabled = false;
featureFlag.inviteEnabled = false;
featureFlag.kickOutEnabled = false;
featureFlag.liveStreamingEnabled = false;
featureFlag.meetingPasswordEnabled = false;
featureFlag.recordingEnabled = false;
featureFlag.serverURLChangeEnabled = false;
featureFlag.tileViewEnabled = false;
featureFlag.videoShareButtonEnabled = false;
if (Platform.isIOS) {
featureFlag.pipEnabled = false;
}
var options = JitsiMeetingOptions()
..room = code // Required, spaces will be trimmed
..userDisplayName = username == null ? 'Unidentified' : username
..audioMuted = false
..videoMuted = false
..featureFlag = featureFlag;
await JitsiMeet.joinMeeting(options);
} catch (err) {
print(err);
}
}
错误在行..featureFlag = featureFlag;上面写着
The setter 'featureFlag' isn't defined for the type 'JitsiMeetingOptions'.
Try importing the library that defines 'featureFlag', correcting the name to the name of an existing setter, or defining a setter or field named 'featureFlag'.
我已经按照包的文档 https://pub.dev/packages/jitsi_meet 输入了所有内容,但代码似乎仍然无法正常工作。任何有关如何修复此错误并使代码正常工作的帮助都将大有帮助。
新版本的jitsi meet plugin 3.0.0修改了featureflag,但是pub dev主页上没有提到修改的代码https://pub.dev/packages/jitsi_meet. So please check out the example page where new changed syntax has been mentioned i.e https://pub.dev/packages/jitsi_meet/example .
例如你的代码应该是这样的,根据新版本找出需要更改的语法:-
_joinMeeting() async {
String serverUrl =
serverText.text?.trim()?.isEmpty ?? "" ? null : serverText.text;
// Enable or disable any feature flag here
// If feature flag are not provided, default values will be used
// Full list of feature flags (and defaults) available in the README
Map<FeatureFlagEnum, bool> featureFlags = {
FeatureFlagEnum.WELCOME_PAGE_ENABLED: false,
};
if (!kIsWeb) {
// Here is an example, disabling features for each platform
if (Platform.isAndroid) {
// Disable ConnectionService usage on Android to avoid issues (see README)
featureFlags[FeatureFlagEnum.CALL_INTEGRATION_ENABLED] = false;
} else if (Platform.isIOS) {
// Disable PIP on iOS as it looks weird
featureFlags[FeatureFlagEnum.PIP_ENABLED] = false;
}
}
// Define meetings options here
var options = JitsiMeetingOptions()
..room = roomText.text
..serverURL = serverUrl
..subject = subjectText.text
..userDisplayName = nameText.text
..userEmail = emailText.text
..iosAppBarRGBAColor = iosAppBarRGBAColor.text
..audioOnly = isAudioOnly
..audioMuted = isAudioMuted
..videoMuted = isVideoMuted
..featureFlags.addAll(featureFlags)
..webOptions = {
"roomName": roomText.text,
"width": "100%",
"height": "100%",
"enableWelcomePage": false,
"chromeExtensionBanner": null,
"userInfo": {"displayName": nameText.text}
};
我正在使用 jitsi meet 包进行 flutter 并且我已经按照包的文档 https://pub.dev/packages/jitsi_meet 键入了代码,但是应用程序中仍然存在一些错误。错误说
The setter 'featureFlag' isn't defined for the type 'JitsiMeetingOptions'.
Try importing the library that defines 'featureFlag', correcting the name to the name of an existing setter, or defining a setter or field named 'featureFlag'.
这是加入会议功能
joinMeeting() async {
print(code);
try {
FeatureFlag featureFlag = FeatureFlag();
featureFlag.welcomePageEnabled = false;
featureFlag.resolution = FeatureFlagVideoResolution.MD_RESOLUTION;
featureFlag.addPeopleEnabled = false;
featureFlag.calendarEnabled = false;
featureFlag.callIntegrationEnabled = false;
featureFlag.inviteEnabled = false;
featureFlag.kickOutEnabled = false;
featureFlag.liveStreamingEnabled = false;
featureFlag.meetingPasswordEnabled = false;
featureFlag.recordingEnabled = false;
featureFlag.serverURLChangeEnabled = false;
featureFlag.tileViewEnabled = false;
featureFlag.videoShareButtonEnabled = false;
if (Platform.isIOS) {
featureFlag.pipEnabled = false;
}
var options = JitsiMeetingOptions()
..room = code // Required, spaces will be trimmed
..userDisplayName = username == null ? 'Unidentified' : username
..audioMuted = false
..videoMuted = false
..featureFlag = featureFlag;
await JitsiMeet.joinMeeting(options);
} catch (err) {
print(err);
}
}
错误在行..featureFlag = featureFlag;上面写着
The setter 'featureFlag' isn't defined for the type 'JitsiMeetingOptions'.
Try importing the library that defines 'featureFlag', correcting the name to the name of an existing setter, or defining a setter or field named 'featureFlag'.
我已经按照包的文档 https://pub.dev/packages/jitsi_meet 输入了所有内容,但代码似乎仍然无法正常工作。任何有关如何修复此错误并使代码正常工作的帮助都将大有帮助。
新版本的jitsi meet plugin 3.0.0修改了featureflag,但是pub dev主页上没有提到修改的代码https://pub.dev/packages/jitsi_meet. So please check out the example page where new changed syntax has been mentioned i.e https://pub.dev/packages/jitsi_meet/example .
例如你的代码应该是这样的,根据新版本找出需要更改的语法:-
_joinMeeting() async {
String serverUrl =
serverText.text?.trim()?.isEmpty ?? "" ? null : serverText.text;
// Enable or disable any feature flag here
// If feature flag are not provided, default values will be used
// Full list of feature flags (and defaults) available in the README
Map<FeatureFlagEnum, bool> featureFlags = {
FeatureFlagEnum.WELCOME_PAGE_ENABLED: false,
};
if (!kIsWeb) {
// Here is an example, disabling features for each platform
if (Platform.isAndroid) {
// Disable ConnectionService usage on Android to avoid issues (see README)
featureFlags[FeatureFlagEnum.CALL_INTEGRATION_ENABLED] = false;
} else if (Platform.isIOS) {
// Disable PIP on iOS as it looks weird
featureFlags[FeatureFlagEnum.PIP_ENABLED] = false;
}
}
// Define meetings options here
var options = JitsiMeetingOptions()
..room = roomText.text
..serverURL = serverUrl
..subject = subjectText.text
..userDisplayName = nameText.text
..userEmail = emailText.text
..iosAppBarRGBAColor = iosAppBarRGBAColor.text
..audioOnly = isAudioOnly
..audioMuted = isAudioMuted
..videoMuted = isVideoMuted
..featureFlags.addAll(featureFlags)
..webOptions = {
"roomName": roomText.text,
"width": "100%",
"height": "100%",
"enableWelcomePage": false,
"chromeExtensionBanner": null,
"userInfo": {"displayName": nameText.text}
};