Fix some MissingPluginExceptions in tests (#1108)

pull/1109/head
Adil Hanney 2 years ago committed by GitHub
parent ab5690a6d7
commit 70fb601796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/src/utils/platform.dart
  2. 4
      lib/src/widgets/raw_editor.dart

@ -26,6 +26,10 @@ bool isAppleOS([TargetPlatform? targetPlatform]) {
}
Future<bool> isIOSSimulator() async {
if (!isAppleOS()) {
return false;
}
final deviceInfo = DeviceInfoPlugin();
final osInfo = await deviceInfo.deviceInfo;

@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math' as math;
// ignore: unnecessary_import
import 'dart:typed_data';
@ -844,6 +845,9 @@ class RawEditorState extends EditorState
if (isKeyboardOS()) {
_keyboardVisible = true;
} else if (!kIsWeb && Platform.environment.containsKey('FLUTTER_TEST')) {
// treat tests like a keyboard OS
_keyboardVisible = true;
} else {
// treat iOS Simulator like a keyboard OS
isIOSSimulator().then((isIosSimulator) {

Loading…
Cancel
Save