Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter 3.24 compatibility + moved lints into dev dependencies #561

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ class _HtmlEditorExampleState extends State<HtmlEditorExample> {
onButtonPressed:
(ButtonType type, bool? status, Function? updateStatus) {
print(
"button '${describeEnum(type)}' pressed, the current selected status is $status");
"button '${type.name}' pressed, the current selected status is $status");
return true;
},
onDropdownChanged: (DropdownType type, dynamic changed,
Function(dynamic)? updateSelectedItem) {
print(
"dropdown '${describeEnum(type)}' changed to $changed");
"dropdown '${type.name}' changed to $changed");
return true;
},
mediaLinkInsertInterceptor:
Expand Down Expand Up @@ -136,7 +136,7 @@ class _HtmlEditorExampleState extends State<HtmlEditorExample> {
},*/
onImageUploadError: (FileUpload? file, String? base64Str,
UploadError error) {
print(describeEnum(error));
print(error.name);
print(base64Str ?? '');
if (file != null) {
print(file.name);
Expand Down
36 changes: 14 additions & 22 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -251,34 +251,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
lints:
dependency: transitive
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "3.0.1"
matcher:
dependency: transitive
description:
Expand All @@ -291,18 +283,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.15.0"
numberpicker:
dependency: transitive
description:
Expand Down Expand Up @@ -408,10 +400,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.2"
vector_math:
dependency: transitive
description:
Expand All @@ -432,10 +424,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.5"
web:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Demonstrates how to use the html_editor_enhanced plugin.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=3.0.0 <4.0.0'

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/html_editor_controller_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class HtmlEditorController extends unsupported.HtmlEditorController {
void addNotification(String html, NotificationType notificationType) async {
await _evaluateJavascript(source: """
\$('.note-status-output').html(
'<div class="alert alert-${describeEnum(notificationType)}">$html</div>'
'<div class="alert alert-${notificationType.name}">$html</div>'
);
""");
recalculateHeight();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/html_editor_controller_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class HtmlEditorController extends unsupported.HtmlEditorController {
_evaluateJavascriptWeb(data: {
'type': 'toIframe: addNotification',
'html': html,
'alertType': 'alert alert-${describeEnum(notificationType)}'
'alertType': 'alert alert-${notificationType.name}'
});
}
recalculateHeight();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/html_editor_widget_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ class _HtmlEditorWidgetMobileState extends State<HtmlEditorWidget> {
"document.onselectionchange = onSelectionChange; console.log('done');");
await controller.evaluateJavascript(
source:
"document.getElementsByClassName('note-editable')[0].setAttribute('inputmode', '${describeEnum(widget.htmlEditorOptions.inputType)}');");
"document.getElementsByClassName('note-editable')[0].setAttribute('inputmode', '${widget.htmlEditorOptions.inputType.name}');");
if ((Theme.of(context).brightness == Brightness.dark ||
widget.htmlEditorOptions.darkMode == true) &&
widget.htmlEditorOptions.darkMode != false) {
Expand Down
3 changes: 1 addition & 2 deletions lib/src/widgets/html_editor_widget_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export 'dart:html';

import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:html_editor_enhanced/html_editor.dart';
Expand Down Expand Up @@ -241,7 +240,7 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
window.parent.postMessage(JSON.stringify({"view": "$createdViewId", "type": "toDart: htmlHeight", "height": height}), "*");
}
if (data["type"].includes("setInputType")) {
document.getElementsByClassName('note-editable')[0].setAttribute('inputmode', '${describeEnum(widget.htmlEditorOptions.inputType)}');
document.getElementsByClassName('note-editable')[0].setAttribute('inputmode', '${widget.htmlEditorOptions.inputType.name}');
}
if (data["type"].includes("setText")) {
\$('#summernote-2').summernote('code', data["text"]);
Expand Down
30 changes: 15 additions & 15 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -236,28 +236,28 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
lints:
dependency: "direct main"
dependency: "direct dev"
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
Expand All @@ -276,18 +276,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: "direct main"
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.15.0"
numberpicker:
dependency: "direct main"
description:
Expand Down Expand Up @@ -393,10 +393,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.2"
vector_math:
dependency: transitive
description:
Expand All @@ -417,10 +417,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.5"
web:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ dependencies:
# related to https://github.com/flutter/flutter/issues/54027
# pinned to 0.9.1 because of issues with CanvasKit in the latest versions
pointer_interceptor: ^0.10.1+1
# plugin to help maintain effective Dart standards
lints: ^4.0.0
# plugin for @internal annotation
meta: '>=1.0.0 <2.0.0'

dev_dependencies:
flutter_test:
sdk: flutter
# plugin to help maintain effective Dart standards
lints: ^4.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down