Skip to content

Commit ecba7ba

Browse files
XazinLucasXu0
andauthored
fix: lessen horizontal editor padding for mobile (#70)
* fix: lessen horizontal editor padding for mobile * Update lib/src/render/style/editor_style.dart Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com> --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
1 parent 865195f commit ecba7ba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

example/lib/home_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class _HomePageState extends State<HomePage> {
7272
key: _scaffoldKey,
7373
extendBodyBehindAppBar: true,
7474
drawer: _buildDrawer(context),
75-
body: _buildBody(context),
75+
body: SafeArea(child: _buildBody(context)),
7676
floatingActionButton: _buildFloatingActionButton(context),
7777
);
7878
}

lib/src/render/style/editor_style.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:flutter/material.dart';
24

35
Iterable<ThemeExtension<dynamic>> get lightEditorStyleExtension => [
@@ -189,7 +191,9 @@ class EditorStyle extends ThemeExtension<EditorStyle> {
189191
}
190192

191193
static final light = EditorStyle(
192-
padding: const EdgeInsets.fromLTRB(200.0, 0.0, 200.0, 0.0),
194+
padding: Platform.isAndroid || Platform.isIOS
195+
? const EdgeInsets.symmetric(horizontal: 20)
196+
: const EdgeInsets.symmetric(horizontal: 200),
193197
backgroundColor: Colors.white,
194198
cursorColor: const Color(0xFF00BCF0),
195199
selectionColor: const Color.fromARGB(53, 111, 201, 231),

0 commit comments

Comments
 (0)