From b229590f9c1c5deddab2b52db591a115f984952d Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Mon, 9 Sep 2024 17:07:44 +0800 Subject: [PATCH] fix: platform.environment is not supported on web --- .../service/shortcuts/character/slash_command.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/editor/editor_component/service/shortcuts/character/slash_command.dart b/lib/src/editor/editor_component/service/shortcuts/character/slash_command.dart index d2b31b630..b4001a6d0 100644 --- a/lib/src/editor/editor_component/service/shortcuts/character/slash_command.dart +++ b/lib/src/editor/editor_component/service/shortcuts/character/slash_command.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:appflowy_editor/appflowy_editor.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; /// Show the slash menu @@ -99,7 +100,7 @@ Future _showSlashMenu( singleColumn: singleColumn, style: style, ); - if (Platform.environment.containsKey('FLUTTER_TEST')) { + if (!kIsWeb && Platform.environment.containsKey('FLUTTER_TEST')) { _selectionMenuService?.show(); } else { await _selectionMenuService?.show();