Update deprecated fields

pull/1539/head
Ellet 1 year ago
parent 2973f03593
commit 79597ea642
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 3
      CHANGELOG.md
  2. 1
      README.md
  3. 30
      example/.metadata
  4. 6
      example/windows/CMakeLists.txt
  5. 7
      example/windows/flutter/CMakeLists.txt
  6. 3
      flutter_quill_extensions/CHANGELOG.md
  7. 2
      lib/src/models/config/shared_configurations.dart
  8. 2
      lib/src/models/config/toolbar/buttons/color.dart
  9. 6
      lib/src/models/rules/delete.dart
  10. 65
      lib/src/widgets/proxy.dart
  11. 1675
      lib/src/widgets/raw_editor/raw_editor.dart
  12. 13
      lib/src/widgets/raw_editor/raw_editor_state.dart
  13. 2
      lib/src/widgets/text_line.dart
  14. 2
      pubspec.yaml

@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## 8.5.6
* Support [Flutter 3.16](https://medium.com/flutter/whats-new-in-flutter-3-16-dba6cb1015d1)
## 8.5.5 ## 8.5.5
* Now when opening dialogs by `QuillToolbar` you will not get an exception when you don't use `FlutterQuillLocalizations.delegate` in your `WidgetsApp`, `MaterialApp`, or `CupertinoApp`. The fix is for the `QuillToolbarSearchButton`, `QuillToolbarLinkStyleButton`, and `QuillToolbarColorButton` buttons * Now when opening dialogs by `QuillToolbar` you will not get an exception when you don't use `FlutterQuillLocalizations.delegate` in your `WidgetsApp`, `MaterialApp`, or `CupertinoApp`. The fix is for the `QuillToolbarSearchButton`, `QuillToolbarLinkStyleButton`, and `QuillToolbarColorButton` buttons

@ -87,7 +87,6 @@ dependencies:
git: https://github.com/singerdmx/flutter-quill.git git: https://github.com/singerdmx/flutter-quill.git
``` ```
> >
> Note: At this time, we are making too many changes to the library, and you might see a new version almost every day > Note: At this time, we are making too many changes to the library, and you might see a new version almost every day
> >

@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited. # This file should be version controlled and should not be manually edited.
version: version:
revision: "d211f42860350d914a5ad8102f9ec32764dc6d06" revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a"
channel: "stable" channel: "stable"
project_type: app project_type: app
@ -13,26 +13,26 @@ project_type: app
migration: migration:
platforms: platforms:
- platform: root - platform: root
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: android - platform: android
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: ios - platform: ios
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: linux - platform: linux
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: macos - platform: macos
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: web - platform: web
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: windows - platform: windows
create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
# User provided section # User provided section

@ -87,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES)
COMPONENT Runtime) COMPONENT Runtime)
endif() endif()
# Copy the native assets provided by the build.dart from all packages.
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
install(DIRECTORY "${NATIVE_ASSETS_DIR}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
# Fully re-copy the assets directory on each build to avoid having stale files # Fully re-copy the assets directory on each build to avoid having stale files
# from a previous install. # from a previous install.
set(FLUTTER_ASSET_DIR_NAME "flutter_assets") set(FLUTTER_ASSET_DIR_NAME "flutter_assets")

@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
# https://github.com/flutter/flutter/issues/57146. # https://github.com/flutter/flutter/issues/57146.
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
# Set fallback configurations for older versions of the flutter tool.
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
set(FLUTTER_TARGET_PLATFORM "windows-x64")
endif()
# === Flutter Library === # === Flutter Library ===
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
@ -92,7 +97,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT} ${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG> ${FLUTTER_TARGET_PLATFORM} $<CONFIG>
VERBATIM VERBATIM
) )
add_custom_target(flutter_assemble DEPENDS add_custom_target(flutter_assemble DEPENDS

@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## 0.6.11
* Support [Flutter 3.16](https://medium.com/flutter/whats-new-in-flutter-3-16-dba6cb1015d1)
## 0.6.10 ## 0.6.10
* Update deprecated members from `flutter_quill` * Update deprecated members from `flutter_quill`
* Update doc and `README.md` * Update doc and `README.md`

@ -1,9 +1,9 @@
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart' show Color, Colors, Locale; import 'package:flutter/material.dart' show Color, Colors, Locale;
import '../themes/quill_dialog_theme.dart';
import './editor/configurations.dart' show QuillEditorConfigurations; import './editor/configurations.dart' show QuillEditorConfigurations;
import './toolbar/configurations.dart' show QuillToolbarConfigurations; import './toolbar/configurations.dart' show QuillToolbarConfigurations;
import '../themes/quill_dialog_theme.dart';
import 'others/animations.dart'; import 'others/animations.dart';
export './others/animations.dart'; export './others/animations.dart';

@ -1,7 +1,7 @@
import 'package:flutter/widgets.dart' show Color; import 'package:flutter/widgets.dart' show Color;
import './../../shared_configurations.dart' show QuillSharedConfigurations;
import '../../../../widgets/controller.dart'; import '../../../../widgets/controller.dart';
import './../../shared_configurations.dart' show QuillSharedConfigurations;
import 'base.dart'; import 'base.dart';
class QuillToolbarColorButtonExtraOptions class QuillToolbarColorButtonExtraOptions

@ -97,10 +97,8 @@ class PreserveLineStyleOnMergeRule extends DeleteRule {
continue; continue;
} }
var attributes = op.attributes == null var attributes = op.attributes?.map<String, dynamic>(
? null (key, dynamic value) => MapEntry<String, dynamic>(key, null));
: op.attributes!.map<String, dynamic>(
(key, dynamic value) => MapEntry<String, dynamic>(key, null));
if (isNotPlain) { if (isNotPlain) {
attributes ??= <String, dynamic>{}; attributes ??= <String, dynamic>{};

@ -129,22 +129,24 @@ class RenderEmbedProxy extends RenderProxyBox implements RenderContentProxyBox {
class RichTextProxy extends SingleChildRenderObjectWidget { class RichTextProxy extends SingleChildRenderObjectWidget {
/// Child argument should be an instance of RichText widget. /// Child argument should be an instance of RichText widget.
const RichTextProxy( const RichTextProxy({
{required RichText super.child, required RichText super.child,
required this.textStyle, required this.textStyle,
required this.textAlign, required this.textAlign,
required this.textDirection, required this.textDirection,
required this.locale, required this.locale,
required this.strutStyle, required this.strutStyle,
this.textScaleFactor = 1.0, // TODO: This might needs to be updated, previous value was 1.0 using `textScaleFactor`
this.textWidthBasis = TextWidthBasis.parent, this.textScaler = const TextScaler.linear(1),
this.textHeightBehavior, this.textWidthBasis = TextWidthBasis.parent,
super.key}); this.textHeightBehavior,
super.key,
});
final TextStyle textStyle; final TextStyle textStyle;
final TextAlign textAlign; final TextAlign textAlign;
final TextDirection textDirection; final TextDirection textDirection;
final double textScaleFactor; final TextScaler textScaler;
final Locale locale; final Locale locale;
final StrutStyle strutStyle; final StrutStyle strutStyle;
final TextWidthBasis textWidthBasis; final TextWidthBasis textWidthBasis;
@ -152,16 +154,8 @@ class RichTextProxy extends SingleChildRenderObjectWidget {
@override @override
RenderParagraphProxy createRenderObject(BuildContext context) { RenderParagraphProxy createRenderObject(BuildContext context) {
return RenderParagraphProxy( return RenderParagraphProxy(null, textStyle, textAlign, textDirection,
null, textScaler, strutStyle, locale, textWidthBasis, textHeightBehavior);
textStyle,
textAlign,
textDirection,
textScaleFactor,
strutStyle,
locale,
textWidthBasis,
textHeightBehavior);
} }
@override @override
@ -171,7 +165,7 @@ class RichTextProxy extends SingleChildRenderObjectWidget {
..textStyle = textStyle ..textStyle = textStyle
..textAlign = textAlign ..textAlign = textAlign
..textDirection = textDirection ..textDirection = textDirection
..textScaleFactor = textScaleFactor ..textScaler = textScaler
..locale = locale ..locale = locale
..strutStyle = strutStyle ..strutStyle = strutStyle
..textWidthBasis = textWidthBasis ..textWidthBasis = textWidthBasis
@ -186,20 +180,21 @@ class RenderParagraphProxy extends RenderProxyBox
TextStyle textStyle, TextStyle textStyle,
TextAlign textAlign, TextAlign textAlign,
TextDirection textDirection, TextDirection textDirection,
double textScaleFactor, TextScaler textScaler,
StrutStyle strutStyle, StrutStyle strutStyle,
Locale locale, Locale locale,
TextWidthBasis textWidthBasis, TextWidthBasis textWidthBasis,
TextHeightBehavior? textHeightBehavior, TextHeightBehavior? textHeightBehavior,
) : _prototypePainter = TextPainter( ) : _prototypePainter = TextPainter(
text: TextSpan(text: ' ', style: textStyle), text: TextSpan(text: ' ', style: textStyle),
textAlign: textAlign, textAlign: textAlign,
textDirection: textDirection, textDirection: textDirection,
textScaleFactor: textScaleFactor, textScaler: textScaler,
strutStyle: strutStyle, strutStyle: strutStyle,
locale: locale, locale: locale,
textWidthBasis: textWidthBasis, textWidthBasis: textWidthBasis,
textHeightBehavior: textHeightBehavior); textHeightBehavior: textHeightBehavior,
);
final TextPainter _prototypePainter; final TextPainter _prototypePainter;
@ -227,11 +222,11 @@ class RenderParagraphProxy extends RenderProxyBox
markNeedsLayout(); markNeedsLayout();
} }
set textScaleFactor(double value) { set textScaler(TextScaler value) {
if (_prototypePainter.textScaleFactor == value) { if (_prototypePainter.textScaler == value) {
return; return;
} }
_prototypePainter.textScaleFactor = value; _prototypePainter.textScaler = value;
markNeedsLayout(); markNeedsLayout();
} }

File diff suppressed because it is too large Load Diff

@ -133,6 +133,9 @@ class QuillRawEditorState extends EditorState
onSelectAll: selectAllEnabled onSelectAll: selectAllEnabled
? () => selectAll(SelectionChangedCause.toolbar) ? () => selectAll(SelectionChangedCause.toolbar)
: null, : null,
onLookUp: null,
onSearchWeb: null,
onShare: null,
); );
} }
@ -1612,6 +1615,14 @@ class QuillRawEditorState extends EditorState
} }
@override @override
// TODO: implement liveTextInputEnabled
bool get liveTextInputEnabled => false; bool get liveTextInputEnabled => false;
@override
bool get lookUpEnabled => false;
@override
bool get searchWebEnabled => false;
@override
bool get shareEnabled => false;
} }

@ -172,7 +172,7 @@ class _TextLineState extends State<TextLine> {
textAlign: textAlign, textAlign: textAlign,
textDirection: widget.textDirection, textDirection: widget.textDirection,
strutStyle: strutStyle, strutStyle: strutStyle,
textScaleFactor: MediaQuery.textScaleFactorOf(context), textScaler: MediaQuery.textScalerOf(context),
); );
return RichTextProxy( return RichTextProxy(
textStyle: textSpan.style!, textStyle: textSpan.style!,

@ -1,6 +1,6 @@
name: flutter_quill name: flutter_quill
description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter. description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter.
version: 8.5.5 version: 8.5.6
homepage: https://1o24bbs.com/c/bulletjournal/108 homepage: https://1o24bbs.com/c/bulletjournal/108
repository: https://github.com/singerdmx/flutter-quill repository: https://github.com/singerdmx/flutter-quill

Loading…
Cancel
Save