Skip to content

Commit

Permalink
fix: remove platform check in theme on web
Browse files Browse the repository at this point in the history
Closes: #89
  • Loading branch information
Xazin committed Apr 22, 2023
1 parent 30f231a commit ef12ee5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/src/render/style/editor_style.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

Iterable<ThemeExtension<dynamic>> get lightEditorStyleExtension => [
Expand Down Expand Up @@ -204,7 +205,7 @@ class EditorStyle extends ThemeExtension<EditorStyle> {
}

static final light = EditorStyle(
padding: Platform.isAndroid || Platform.isIOS
padding: _isMobile
? const EdgeInsets.symmetric(horizontal: 20)
: const EdgeInsets.symmetric(horizontal: 200),
backgroundColor: Colors.white,
Expand Down Expand Up @@ -258,4 +259,16 @@ class EditorStyle extends ThemeExtension<EditorStyle> {
popupMenuFGColor: Colors.white,
popupMenuHoverColor: const Color(0xFF00BCF0),
);

static bool get _isMobile {
if (kIsWeb) {
return false;
}

if (Platform.isAndroid || Platform.isIOS) {
return true;
}

return false;
}
}
5 changes: 5 additions & 0 deletions lib/src/service/shortcut_event/shortcut_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ class ShortcutEvent {
}
var matched = false;
if (kIsWeb) {
debugPrint("REACHED ONE!");
debugPrint("REACHED ONE!!");
debugPrint("REACHED ONE!!!");
debugPrint("REACHED ONE!!!!");
debugPrint("REACHED ONE!!!!!");
// We shouldn't continue to run the below `else if` code in Web platform, it will throw an `_operatingSystem` exception.
if (command != null && command.isNotEmpty) {
this.command = command;
Expand Down

0 comments on commit ef12ee5

Please sign in to comment.