From 721cf7b36e9e7306315c3b9266b9dff655e4071c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Arteiro?= Date: Tue, 19 Sep 2023 20:31:48 +0100 Subject: [PATCH] feat: Migrating home page. #3 --- ios/Podfile.lock | 17 +- lib/home_page.dart | 231 +++++++----------- lib/web_embeds/mobile_platform_registry.dart | 6 - lib/web_embeds/web_embeds.dart | 80 ------ lib/web_embeds/web_platform_registry.dart | 10 - linux/flutter/generated_plugin_registrant.cc | 4 - linux/flutter/generated_plugins.cmake | 1 - macos/Flutter/GeneratedPluginRegistrant.swift | 4 +- pubspec.lock | 178 +++----------- pubspec.yaml | 9 +- test/widget_test.dart | 5 +- .../flutter/generated_plugin_registrant.cc | 6 +- windows/flutter/generated_plugins.cmake | 2 +- 13 files changed, 137 insertions(+), 416 deletions(-) delete mode 100644 lib/web_embeds/mobile_platform_registry.dart delete mode 100644 lib/web_embeds/web_embeds.dart delete mode 100644 lib/web_embeds/web_platform_registry.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 359c8c4..b6eaa59 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -45,15 +45,14 @@ PODS: - OrderedSet (~> 5.0) - flutter_keyboard_visibility (0.0.1): - Flutter - - gallery_saver (0.0.1): + - gal (1.0.0): - Flutter + - FlutterMacOS - image_picker_ios (0.0.1): - Flutter - integration_test (0.0.1): - Flutter - OrderedSet (5.0.0) - - pasteboard (0.0.1): - - Flutter - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS @@ -72,10 +71,9 @@ DEPENDENCIES: - Flutter (from `Flutter`) - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - - gallery_saver (from `.symlinks/plugins/gallery_saver/ios`) + - gal (from `.symlinks/plugins/gal/darwin`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - integration_test (from `.symlinks/plugins/integration_test/ios`) - - pasteboard (from `.symlinks/plugins/pasteboard/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) @@ -99,14 +97,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_inappwebview/ios" flutter_keyboard_visibility: :path: ".symlinks/plugins/flutter_keyboard_visibility/ios" - gallery_saver: - :path: ".symlinks/plugins/gallery_saver/ios" + gal: + :path: ".symlinks/plugins/gal/darwin" image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" integration_test: :path: ".symlinks/plugins/integration_test/ios" - pasteboard: - :path: ".symlinks/plugins/pasteboard/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" url_launcher_ios: @@ -122,11 +118,10 @@ SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721 flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 - gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542 + gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 integration_test: 13825b8a9334a850581300559b8839134b124670 OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c - pasteboard: 982969ebaa7c78af3e6cc7761e8f5e77565d9ce0 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 SDWebImage: 2aea163b50bfcb569a2726b6a754c54a4506fcf6 SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f diff --git a/lib/home_page.dart b/lib/home_page.dart index 81239c9..5a05095 100644 --- a/lib/home_page.dart +++ b/lib/home_page.dart @@ -6,25 +6,16 @@ import 'dart:ui'; import 'package:app/main.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_quill/extensions.dart'; -import 'package:flutter_quill/flutter_quill.dart' hide Text; -import 'package:flutter_quill_extensions/flutter_quill_extensions.dart'; +import 'package:visual_editor/document/models/attributes/attributes.model.dart'; +import 'package:visual_editor/visual-editor.dart'; import 'package:path/path.dart'; import 'package:path_provider/path_provider.dart'; import 'package:http/http.dart' as http; import 'package:mime/mime.dart'; import 'package:http_parser/http_parser.dart'; -import 'web_embeds/web_embeds.dart'; - const quillEditorKey = Key('quillEditorKey'); -/// Types of selection that person can make when triple clicking -enum _SelectionType { - none, - word, -} - /// Home page with the `flutter-quill` editor class HomePage extends StatefulWidget { const HomePage({ @@ -40,14 +31,11 @@ class HomePage extends StatefulWidget { class HomePageState extends State { /// `flutter-quill` editor controller - QuillController? _controller; + EditorController? _controller; /// Focus node used to obtain keyboard focus and events final FocusNode _focusNode = FocusNode(); - /// Selection types for triple clicking - _SelectionType _selectionType = _SelectionType.none; - @override void initState() { super.initState(); @@ -57,11 +45,10 @@ class HomePageState extends State { /// Initializing the [Delta](https://quilljs.com/docs/delta/) document with sample text. Future _initializeText() async { // final doc = Document()..insert(0, 'Just a friendly empty text :)'); - final doc = Document(); + final doc = DeltaDocM(); setState(() { - _controller = QuillController( + _controller = EditorController( document: doc, - selection: const TextSelection.collapsed(offset: 0), ); }); } @@ -87,184 +74,134 @@ class HomePageState extends State { ); } - /// Callback called whenever the person taps on the text. - /// It will select nothing, then the word if another tap is detected - /// and then the whole text if another tap is detected (triple). - bool _onTripleClickSelection() { - final controller = _controller!; - - // If nothing is selected, selection type is `none` - if (controller.selection.isCollapsed) { - _selectionType = _SelectionType.none; - } - - // If nothing is selected, selection type becomes `word - if (_selectionType == _SelectionType.none) { - _selectionType = _SelectionType.word; - return false; - } - - // If the word is selected, select all text - if (_selectionType == _SelectionType.word) { - final child = controller.document.queryChild( - controller.selection.baseOffset, - ); - final offset = child.node?.documentOffset ?? 0; - final length = child.node?.length ?? 0; - - final selection = TextSelection( - baseOffset: offset, - extentOffset: offset + length, - ); - - // Select all text and make next selection to `none` - controller.updateSelection(selection, ChangeSource.REMOTE); - - _selectionType = _SelectionType.none; - - return true; - } - - return false; - } - /// Build the `flutter-quill` editor to be shown on screen. Widget _buildEditor(BuildContext context) { // Default editor (for mobile devices) - Widget quillEditor = QuillEditor( + Widget quillEditor = VisualEditor( controller: _controller!, scrollController: ScrollController(), - scrollable: true, focusNode: _focusNode, - autoFocus: false, - readOnly: false, - placeholder: 'Write what\'s on your mind.', - enableSelectionToolbar: isMobile(), - expands: false, - padding: EdgeInsets.zero, - onTapUp: (details, p1) { - return _onTripleClickSelection(); - }, - customStyles: DefaultStyles( - h1: DefaultTextBlockStyle( - const TextStyle( - fontSize: 32, - color: Colors.black, - height: 1.15, - fontWeight: FontWeight.w300, - ), - const VerticalSpacing(16, 0), - const VerticalSpacing(0, 0), - null, - ), - sizeSmall: const TextStyle(fontSize: 9), - subscript: const TextStyle( - fontFamily: 'SF-UI-Display', - fontFeatures: [FontFeature.subscripts()], - ), - superscript: const TextStyle( - fontFamily: 'SF-UI-Display', - fontFeatures: [FontFeature.superscripts()], - ), - ), - embedBuilders: [...FlutterQuillEmbeds.builders()], - ); - - // Alternatively, the web editor version is shown (with the web embeds) - if (widget.platformService.isWebPlatform()) { - quillEditor = QuillEditor( - controller: _controller!, - scrollController: ScrollController(), + config: EditorConfigM( scrollable: true, - focusNode: _focusNode, autoFocus: false, readOnly: false, - placeholder: 'Add content', + placeholder: 'Write what\'s on your mind.', + enableInteractiveSelection: true, expands: false, padding: EdgeInsets.zero, - onTapUp: (details, p1) { - return _onTripleClickSelection(); - }, - customStyles: DefaultStyles( - h1: DefaultTextBlockStyle( - const TextStyle( + customStyles: const EditorStylesM( + h1: TextBlockStyleM( + TextStyle( fontSize: 32, color: Colors.black, height: 1.15, fontWeight: FontWeight.w300, ), - const VerticalSpacing(16, 0), - const VerticalSpacing(0, 0), + VerticalSpacing(top: 16, bottom: 0), + VerticalSpacing(top: 0, bottom: 0), + VerticalSpacing(top: 16, bottom: 0), null, ), - sizeSmall: const TextStyle(fontSize: 9), + sizeSmall: TextStyle(fontSize: 9), + ), + ), + ); + + // Alternatively, the web editor version is shown (with the web embeds) + if (widget.platformService.isWebPlatform()) { + quillEditor = VisualEditor( + controller: _controller!, + scrollController: ScrollController(), + focusNode: _focusNode, + config: EditorConfigM( + scrollable: true, + enableInteractiveSelection: false, + autoFocus: false, + readOnly: false, + placeholder: 'Add content', + expands: false, + padding: EdgeInsets.zero, + customStyles: const EditorStylesM( + h1: TextBlockStyleM( + TextStyle( + fontSize: 32, + color: Colors.black, + height: 1.15, + fontWeight: FontWeight.w300, + ), + VerticalSpacing(top: 16, bottom: 0), + VerticalSpacing(top: 0, bottom: 0), + VerticalSpacing(top: 16, bottom: 0), + null, + ), + sizeSmall: TextStyle(fontSize: 9), + ), ), - embedBuilders: [...defaultEmbedBuildersWeb], ); } // Toolbar definitions const toolbarIconSize = 18.0; - final embedButtons = FlutterQuillEmbeds.buttons( - // Showing only necessary default buttons - showCameraButton: false, - showFormulaButton: false, - showVideoButton: false, - showImageButton: true, - - // `onImagePickCallback` is called after image is picked on mobile platforms - onImagePickCallback: _onImagePickCallback, - - // `webImagePickImpl` is called after image is picked on the web - webImagePickImpl: _webImagePickImpl, - - // defining the selector (we only want to open the gallery whenever the person wants to upload an image) - mediaPickSettingSelector: (context) { - return Future.value(MediaPickSetting.Gallery); - }, - ); + const toolbarButtonSpacing = 2.5; // Instantiating the toolbar - final toolbar = QuillToolbar( - afterButtonPressed: _focusNode.requestFocus, + final toolbar = EditorToolbar( children: [ HistoryButton( + buttonsSpacing: toolbarButtonSpacing, icon: Icons.undo_outlined, iconSize: toolbarIconSize, controller: _controller!, - undo: true, + isUndo: true, ), HistoryButton( + buttonsSpacing: toolbarButtonSpacing, icon: Icons.redo_outlined, iconSize: toolbarIconSize, controller: _controller!, - undo: false, + isUndo: false, ), ToggleStyleButton( - attribute: Attribute.bold, + buttonsSpacing: toolbarButtonSpacing, + attribute: AttributesM.bold, icon: Icons.format_bold, iconSize: toolbarIconSize, controller: _controller!, ), ToggleStyleButton( - attribute: Attribute.italic, + buttonsSpacing: toolbarButtonSpacing, + attribute: AttributesM.italic, icon: Icons.format_italic, iconSize: toolbarIconSize, controller: _controller!, ), ToggleStyleButton( - attribute: Attribute.underline, + buttonsSpacing: toolbarButtonSpacing, + attribute: AttributesM.underline, icon: Icons.format_underline, iconSize: toolbarIconSize, controller: _controller!, ), ToggleStyleButton( - attribute: Attribute.strikeThrough, + buttonsSpacing: toolbarButtonSpacing, + attribute: AttributesM.strikeThrough, icon: Icons.format_strikethrough, iconSize: toolbarIconSize, controller: _controller!, ), - for (final builder in embedButtons) builder(_controller!, toolbarIconSize, null, null), + + // Our embed buttons + ImageButton( + icon: Icons.image, + iconSize: toolbarIconSize, + buttonsSpacing: toolbarButtonSpacing, + controller: _controller!, + onImagePickCallback: _onImagePickCallback, + webImagePickImpl: _webImagePickImpl, + mediaPickSettingSelector: (context) { + return Future.value(MediaPickSettingE.Gallery); + }, + ) ], ); @@ -291,12 +228,12 @@ class HomePageState extends State { /// Renders the image picked by imagePicker from local file storage /// You can also upload the picked image to any server (eg : AWS s3 /// or Firebase) and then return the uploaded image URL. - /// + /// /// It's only called on mobile platforms. Future _onImagePickCallback(File file) async { - final appDocDir = await getApplicationDocumentsDirectory(); - final copiedFile = await file.copy('${appDocDir.path}/${basename(file.path)}'); - return copiedFile.path.toString(); + final appDocDir = await getApplicationDocumentsDirectory(); + final copiedFile = await file.copy('${appDocDir.path}/${basename(file.path)}'); + return copiedFile.path.toString(); } /// Callback that is called after an image is picked whilst on the web platform. @@ -323,8 +260,12 @@ class HomePageState extends State { const apiURL = 'https://imgup.fly.dev/api/images'; final request = http.MultipartRequest('POST', Uri.parse(apiURL)); - final httpImage = http.MultipartFile.fromBytes('image', bytes, - contentType: MediaType.parse(lookupMimeType('', headerBytes: bytes)!), filename: platformFile.name,); + final httpImage = http.MultipartFile.fromBytes( + 'image', + bytes, + contentType: MediaType.parse(lookupMimeType('', headerBytes: bytes)!), + filename: platformFile.name, + ); request.files.add(httpImage); // Check the response and handle accordingly diff --git a/lib/web_embeds/mobile_platform_registry.dart b/lib/web_embeds/mobile_platform_registry.dart deleted file mode 100644 index 6a94e7e..0000000 --- a/lib/web_embeds/mobile_platform_registry.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Class used to `registerViewFactory` for mobile platforms. -/// -/// Please check https://github.com/flutter/flutter/issues/41563#issuecomment-547923478 for more information. -class PlatformViewRegistry { - static void registerViewFactory(String viewId, dynamic cb) {} -} diff --git a/lib/web_embeds/web_embeds.dart b/lib/web_embeds/web_embeds.dart deleted file mode 100644 index 36e2094..0000000 --- a/lib/web_embeds/web_embeds.dart +++ /dev/null @@ -1,80 +0,0 @@ -import 'package:app/main.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_quill/flutter_quill.dart'; -import 'package:flutter_quill_extensions/flutter_quill_extensions.dart'; -import 'package:responsive_framework/responsive_framework.dart'; -import 'package:universal_html/html.dart' as html; - -// Conditionally importing the PlatformViewRegistry class according to the platform -import 'mobile_platform_registry.dart' if (dart.library.html) 'web_platform_registry.dart' as ui_instance; - -/// Class used to conditionally register the view factory. -/// For more information, check https://github.com/flutter/flutter/issues/41563#issuecomment-547923478. -class PlatformViewRegistryFix { - void registerViewFactory(PlatformService platformService, imageURL, dynamic cbFnc) { - if (platformService.isWebPlatform()) { - ui_instance.PlatformViewRegistry.registerViewFactory( - imageURL, - cbFnc, - ); - } - } -} - -/// Class that conditionally registers the `platformViewRegistry`. -class ImageUniversalUI { - PlatformViewRegistryFix platformViewRegistry = PlatformViewRegistryFix(); -} - -/// Custom embed for images to work on the web. -class ImageEmbedBuilderWeb extends EmbedBuilder { - @override - String get key => BlockEmbed.imageType; - - @override - Widget build( - BuildContext context, - QuillController controller, - Embed node, - bool readOnly, - bool inline, - TextStyle textStyle, - ) { - final imageUrl = node.value.data; - if (isImageBase64(imageUrl)) { - // TODO: handle imageUrl of base64 - return const SizedBox(); - } - final size = MediaQuery.of(context).size; - - // This is needed for images to be correctly embedded on the web. - ImageUniversalUI().platformViewRegistry.registerViewFactory(PlatformService(), imageUrl, (viewId) { - return html.ImageElement() - ..src = imageUrl - ..style.height = 'auto' - ..style.width = 'auto'; - }); - - // Rendering responsive image - return Padding( - padding: EdgeInsets.only( - right: ResponsiveBreakpoints.of(context).smallerThan(TABLET) - ? size.width * 0.5 - : (ResponsiveBreakpoints.of(context).equals('4K')) - ? size.width * 0.75 - : size.width * 0.2, - ), - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.45, - child: HtmlElementView( - viewType: imageUrl, - ), - ), - ); - } -} - -/// List of default web embed builders. -List get defaultEmbedBuildersWeb => [ - ImageEmbedBuilderWeb(), - ]; diff --git a/lib/web_embeds/web_platform_registry.dart b/lib/web_embeds/web_platform_registry.dart deleted file mode 100644 index af67a22..0000000 --- a/lib/web_embeds/web_platform_registry.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'dart:ui_web' as web_ui; - -/// Class used to `registerViewFactory` for web platforms. -/// -/// Please check https://github.com/flutter/flutter/issues/41563#issuecomment-547923478 for more information. -class PlatformViewRegistry { - static void registerViewFactory(String viewId, dynamic cb) { - web_ui.platformViewRegistry.registerViewFactory(viewId, cb); - } -} diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 158f759..7299b5c 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,16 +7,12 @@ #include "generated_plugin_registrant.h" #include -#include #include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_registrar); - g_autoptr(FlPluginRegistrar) pasteboard_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin"); - pasteboard_plugin_register_with_registrar(pasteboard_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 93c755e..786ff5c 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux - pasteboard url_launcher_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index a6432e6..231f4f6 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,14 +7,14 @@ import Foundation import device_info_plus import file_selector_macos -import pasteboard +import gal import path_provider_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) - PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) + GalPlugin.register(with: registry.registrar(forPlugin: "GalPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 6520309..d94bd1e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -217,6 +217,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.1" + dio: + dependency: transitive + description: + name: dio + sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197 + url: "https://pub.dev" + source: hosted + version: "5.3.2" equatable: dependency: transitive description: @@ -379,19 +387,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.2" - flutter_localizations: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - flutter_math_fork: - dependency: transitive - description: - name: flutter_math_fork - sha256: a143a3a89131b578043ecbdb5e759c1033a1b3e9174f5cd1b979d93f4a7fb41c - url: "https://pub.dev" - source: hosted - version: "0.7.1" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -400,30 +395,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.15" - flutter_quill: - dependency: "direct main" - description: - name: flutter_quill - sha256: e5d517b957e839579ad44bb73e3ac1b315c9ce2d10eee6f2df44e38cb5e13510 - url: "https://pub.dev" - source: hosted - version: "7.4.1" - flutter_quill_extensions: - dependency: "direct main" - description: - name: flutter_quill_extensions - sha256: "2881381283c2f31697ba0a5ce4f1b4eb1639d33b10c4252c0de601e4ae640347" - url: "https://pub.dev" - source: hosted - version: "0.4.1" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" - url: "https://pub.dev" - source: hosted - version: "2.0.7" flutter_test: dependency: "direct dev" description: flutter @@ -447,14 +418,14 @@ packages: description: flutter source: sdk version: "0.0.0" - gallery_saver: + gal: dependency: transitive description: - name: gallery_saver - sha256: df8b7e207ca12d64c71e0710a7ee3bc48aa7206d51cc720716fedb1543a66712 + name: gal + sha256: "2132ff8cb3ba8ce9cbcacbf63ceb86bfe354ebe69997b4e14b3ef7bdd21af82e" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.1.1" glob: dependency: transitive description: @@ -463,22 +434,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" - graphs: + google_fonts: dependency: transitive description: - name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + name: google_fonts + sha256: e20ff62b158b96f392bfc8afe29dee1503c94fbea2cbe8186fd59b756b8ae982 url: "https://pub.dev" source: hosted - version: "2.3.1" - holding_gesture: + version: "5.1.0" + graphs: dependency: transitive description: - name: holding_gesture - sha256: beb26bb731d7d67595c4895b42fa7962c209cecee8def42b665c495648d4620f + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "2.3.1" html: dependency: transitive description: @@ -491,10 +462,10 @@ packages: dependency: "direct main" description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "1.1.0" http_multi_server: dependency: transitive description: @@ -652,22 +623,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" - math_expressions: - dependency: transitive - description: - name: math_expressions - sha256: "3576593617c3870d75728a751f6ec6e606706d44e363f088ac394b5a28a98064" - url: "https://pub.dev" - source: hosted - version: "2.4.0" - math_keyboard: - dependency: transitive - description: - name: math_keyboard - sha256: "4f5d4eb4b7f003715e2ae7d1f58f5f1fddd9dd746d1f1bbc27f1c967e10124d4" - url: "https://pub.dev" - source: hosted - version: "0.2.1" meta: dependency: transitive description: @@ -692,14 +647,6 @@ packages: url: "https://pub.dev" source: hosted version: "5.4.2" - nested: - dependency: transitive - description: - name: nested - sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.dev" - source: hosted - version: "1.0.0" package_config: dependency: transitive description: @@ -708,14 +655,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" - pasteboard: - dependency: transitive - description: - name: pasteboard - sha256: "1c8b6a8b3f1d12e55d4e9404433cda1b4abe66db6b17bc2d2fb5965772c04674" - url: "https://pub.dev" - source: hosted - version: "0.2.0" path: dependency: "direct main" description: @@ -724,14 +663,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf - url: "https://pub.dev" - source: hosted - version: "1.0.1" path_provider: dependency: "direct main" description: @@ -788,14 +719,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.1" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.dev" - source: hosted - version: "5.4.0" photo_view: dependency: transitive description: @@ -836,14 +759,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.2.4" - provider: - dependency: transitive - description: - name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f - url: "https://pub.dev" - source: hosted - version: "6.0.5" pub_semver: dependency: transitive description: @@ -993,14 +908,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.1" - tuple: - dependency: transitive - description: - name: tuple - sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" - source: hosted - version: "2.0.2" typed_data: dependency: transitive description: @@ -1089,30 +996,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.7" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" - url: "https://pub.dev" - source: hosted - version: "1.1.7" vector_math: dependency: transitive description: @@ -1161,6 +1044,15 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.16" + visual_editor: + dependency: "direct main" + description: + path: "." + ref: "update_dependencies#236" + resolved-ref: ecf9d4075c9f992e6d1463b9b330cb625a09920c + url: "https://github.com/LuchoTurtle/visual-editor.git" + source: git + version: "0.0.1" vm_service: dependency: transitive description: @@ -1225,14 +1117,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" - xml: - dependency: transitive - description: - name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.dev" - source: hosted - version: "6.3.0" yaml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5cd4d62..eb8ecdf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,18 +31,21 @@ dependencies: flutter: sdk: flutter - flutter_quill: ^7.3.3 - flutter_quill_extensions: ^0.4.0 file_picker: ^5.3.3 universal_io: ^2.2.2 responsive_framework: ^1.1.0 universal_html: ^2.2.3 path: ^1.8.3 path_provider: ^2.1.0 - http: ^0.13.6 + http: ^1.1.0 mime: ^1.0.4 http_parser: ^4.0.2 + visual_editor: + git: + url: https://github.com/LuchoTurtle/visual-editor.git + ref: update_dependencies#236 + dev_dependencies: integration_test: sdk: flutter diff --git a/test/widget_test.dart b/test/widget_test.dart index c554423..2aec0be 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -7,7 +7,7 @@ import 'package:cross_file/cross_file.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_quill/flutter_quill.dart'; +import 'package:visual_editor/visual-editor.dart'; import 'package:flutter_quill_extensions/embeds/toolbar/image_button.dart'; import 'package:flutter_quill/flutter_quill_test.dart'; @@ -45,8 +45,7 @@ void mockImagePicker(WidgetTester tester) { } } - tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(channel, - (message) { + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(channel, (message) { return handler(message); }); } diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 7d98a88..236a2f2 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,14 +7,14 @@ #include "generated_plugin_registrant.h" #include -#include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); - PasteboardPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("PasteboardPlugin")); + GalPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("GalPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 722afbe..5d19bf7 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,7 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_windows - pasteboard + gal url_launcher_windows )