Flutter 3.13.0 compability fix (#1361)

* Update editor.dart for compatibility with Flutter version 3.13.0

* Update raw_editor.dart for compatibility with Flutter version 3.13.0

* Fix analyze issues, optimize code
pull/1362/head
Vladimir 2 years ago committed by GitHub
parent dc5f259b34
commit 4f5977b608
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      lib/src/widgets/raw_editor.dart
  2. 2
      lib/src/widgets/toolbar.dart
  3. 4
      lib/src/widgets/toolbar/quill_font_family_button.dart
  4. 3
      lib/src/widgets/toolbar/quill_font_size_button.dart

@ -350,6 +350,7 @@ class RawEditorState extends EditorState
List<ContextMenuButtonItem> get contextMenuButtonItems {
return EditableText.getEditableButtonItems(
clipboardStatus: _clipboardStatus.value,
onLiveTextInput: null,
onCopy: copyEnabled
? () => copySelection(SelectionChangedCause.toolbar)
: null,
@ -1746,6 +1747,10 @@ class RawEditorState extends EditorState
}
}
}
@override
// TODO: implement liveTextInputEnabled
bool get liveTextInputEnabled => false;
}
class _Editor extends MultiChildRenderObjectWidget {

@ -574,7 +574,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
if (showDividers)
QuillDivider(axis,
color: sectionDividerColor, space: sectionDividerSpace),
for (var customButton in customButtons)
for (final customButton in customButtons)
if (customButton.child != null) ...[
InkWell(
onTap: customButton.onTap,

@ -67,6 +67,7 @@ class QuillFontFamilyButton extends StatefulWidget {
class _QuillFontFamilyButtonState extends State<QuillFontFamilyButton> {
late String _defaultDisplayText;
late String _currentValue;
Style get _selectionStyle => widget.controller.getSelectionStyle();
@override
@ -164,7 +165,8 @@ class _QuillFontFamilyButtonState extends State<QuillFontFamilyButton> {
context: context,
elevation: 4,
items: [
for (MapEntry<String, String> fontFamily in widget.rawItemsMap.entries)
for (final MapEntry<String, String> fontFamily
in widget.rawItemsMap.entries)
PopupMenuItem<String>(
key: ValueKey(fontFamily.key),
value: fontFamily.value,

@ -151,7 +151,8 @@ class _QuillFontSizeButtonState extends State<QuillFontSizeButton> {
context: context,
elevation: 4,
items: [
for (MapEntry<String, String> fontSize in widget.rawItemsMap.entries)
for (final MapEntry<String, String> fontSize
in widget.rawItemsMap.entries)
PopupMenuItem<String>(
key: ValueKey(fontSize.key),
value: fontSize.value,

Loading…
Cancel
Save