diff --git a/.gitignore b/.gitignore index a247422..c995026 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,9 @@ build/ !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 + +# ITG additions + +.notes +.DS_Store +.idea diff --git a/lib/src/rendering/rich_editor.dart b/lib/src/rendering/rich_editor.dart index 66a0861..61ef3b0 100644 --- a/lib/src/rendering/rich_editor.dart +++ b/lib/src/rendering/rich_editor.dart @@ -42,7 +42,7 @@ class RichEditorState extends State { @override void initState() { super.initState(); - if (Platform.isIOS) { + if (!kIsWeb && Platform.isIOS) { _initServer(); } } @@ -67,7 +67,7 @@ class RichEditorState extends State { if (_controller != null) { _controller = null; } - if (!Platform.isAndroid) { + if (!kIsWeb && !Platform.isAndroid) { localServer!.close(); } super.dispose(); @@ -96,7 +96,7 @@ class RichEditorState extends State { onWebViewCreated: (controller) async { _controller = controller; setState(() {}); - if (!Platform.isAndroid) { + if (!kIsWeb && !Platform.isAndroid) { await _loadHtmlFromAssets(); } else { await _controller!.loadUrl( diff --git a/lib/src/widgets/editor_tool_bar.dart b/lib/src/widgets/editor_tool_bar.dart index 110bbb2..76165cf 100644 --- a/lib/src/widgets/editor_tool_bar.dart +++ b/lib/src/widgets/editor_tool_bar.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:rich_editor/src/utils/javascript_executor_base.dart'; import 'package:rich_editor/src/widgets/check_dialog.dart'; @@ -193,7 +194,7 @@ class EditorToolBar extends StatelessWidget { ), // TODO: Show font button on iOS Visibility( - visible: Platform.isAndroid, + visible: (!kIsWeb && Platform.isAndroid), child: TabButton( tooltip: 'Font face', icon: Icons.font_download,