Skip to content

Commit

Permalink
fix: remove platform check in theme on web (#91)
Browse files Browse the repository at this point in the history
* fix: remove platform check in theme on web

Closes: #89

* Update shortcut_event.dart

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
  • Loading branch information
Xazin and LucasXu0 authored Apr 24, 2023
1 parent df4c222 commit 32ffcf4
Showing 1 changed file with 14 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;
}
}

0 comments on commit 32ffcf4

Please sign in to comment.