diff --git a/lib/widgets/editor.dart b/lib/widgets/editor.dart index bc817470..028a7dd0 100644 --- a/lib/widgets/editor.dart +++ b/lib/widgets/editor.dart @@ -1,5 +1,4 @@ import 'dart:convert'; -import 'dart:html'; import 'dart:io' as io; import 'dart:math' as math; @@ -23,7 +22,8 @@ import 'package:flutter_quill/widgets/raw_editor.dart'; import 'package:flutter_quill/widgets/responsive_widget.dart'; import 'package:flutter_quill/widgets/text_selection.dart'; import 'package:string_validator/string_validator.dart'; -// import 'package:universal_html/prefer_universal/html.dart' as html; +// ignore: import_of_legacy_library_into_null_safe +import 'package:universal_html/prefer_universal/html.dart' as html; import 'package:url_launcher/url_launcher.dart'; import 'box.dart'; @@ -115,7 +115,7 @@ Widget _defaultEmbedBuilderWeb(BuildContext context, leaf.Embed node) { String imageUrl = node.value.data; Size size = MediaQuery.of(context).size; UniversalUI().platformViewRegistry.registerViewFactory( - imageUrl, (int viewId) => ImageElement()..src = imageUrl); + imageUrl, (int viewId) => html.ImageElement()..src = imageUrl); return Padding( padding: EdgeInsets.only( right: ResponsiveWidget.isMediumScreen(context) diff --git a/pubspec.lock b/pubspec.lock index 7ec2d1b3..a2549c0a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -43,6 +43,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.2" fake_async: dependency: transitive description: @@ -107,6 +121,13 @@ packages: description: flutter source: sdk version: "0.0.0" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" http: dependency: transitive description: @@ -259,6 +280,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + universal_html: + dependency: "direct main" + description: + name: universal_html + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.4" + universal_io: + dependency: transitive + description: + name: universal_io + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" url_launcher: dependency: "direct main" description: @@ -308,6 +343,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + zone_local: + dependency: transitive + description: + name: zone_local + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" sdks: dart: ">=2.12.0 <3.0.0" flutter: ">=1.24.0-10.2.pre" diff --git a/pubspec.yaml b/pubspec.yaml index 1412c9a5..3464da79 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,23 +6,22 @@ homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill.git environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.12.0 <3.0.0" flutter: ">=1.17.0" dependencies: flutter: sdk: flutter collection: ^1.15.0 - tuple: ^2.0.0 - url_launcher: ^6.0.2 + file_picker: ^3.0.0 flutter_colorpicker: ^0.4.0-nullsafety.0 + flutter_keyboard_visibility: ^5.0.0 image_picker: ^0.7.2+1 photo_view: ^0.11.1 - file_picker: ^3.0.0 string_validator: ^0.2.0-nullsafety.0 - flutter_keyboard_visibility: ^5.0.0 - - + tuple: ^2.0.0 + universal_html: ^1.2.4 + url_launcher: ^6.0.2 dev_dependencies: flutter_test: @@ -30,37 +29,34 @@ dev_dependencies: # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec - # The following section is specific to Flutter. -flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages +flutter: null +# To add assets to your package, add an assets section, like this: +# assets: +# - images/a_dot_burr.jpeg +# - images/a_dot_ham.jpeg +# +# For details regarding assets in packages, see +# https://flutter.dev/assets-and-images/#from-packages +# +# An image asset can refer to one or more resolution-specific "variants", see +# https://flutter.dev/assets-and-images/#resolution-aware. +# To add custom fonts to your package, add a fonts section here, +# in this "flutter" section. Each entry in this list should have a +# "family" key with the font family name, and a "fonts" key with a +# list giving the asset and other descriptors for the font. For +# example: +# fonts: +# - family: Schyler +# fonts: +# - asset: fonts/Schyler-Regular.ttf +# - asset: fonts/Schyler-Italic.ttf +# style: italic +# - family: Trajan Pro +# fonts: +# - asset: fonts/TrajanPro.ttf +# - asset: fonts/TrajanPro_Bold.ttf +# weight: 700 +# +# For details regarding fonts in packages, see +# https://flutter.dev/custom-fonts/#from-packages