Merge pull request #12 from itgaia/master

issue: Unsupported operation: Platform._operatingSystem
This commit is contained in:
Festus Olusegun 2021-07-12 09:05:48 +01:00 committed by GitHub
commit 100cbe99d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

6
.gitignore vendored
View File

@ -73,3 +73,9 @@ build/
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
# ITG additions
.notes
.DS_Store
.idea

View File

@ -42,7 +42,7 @@ class RichEditorState extends State<RichEditor> {
@override
void initState() {
super.initState();
if (Platform.isIOS) {
if (!kIsWeb && Platform.isIOS) {
_initServer();
}
}
@ -67,7 +67,7 @@ class RichEditorState extends State<RichEditor> {
if (_controller != null) {
_controller = null;
}
if (!Platform.isAndroid) {
if (!kIsWeb && !Platform.isAndroid) {
localServer!.close();
}
super.dispose();
@ -96,7 +96,7 @@ class RichEditorState extends State<RichEditor> {
onWebViewCreated: (controller) async {
_controller = controller;
setState(() {});
if (!Platform.isAndroid) {
if (!kIsWeb && !Platform.isAndroid) {
await _loadHtmlFromAssets();
} else {
await _controller!.loadUrl(

View File

@ -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,