Fix analyze issues, optimize code

pull/1361/head
vladimirkaroyan 2 years ago
parent bed3787aa9
commit 47eba28500
  1. 2
      lib/src/widgets/editor.dart
  2. 4
      lib/src/widgets/raw_editor.dart
  3. 2
      lib/src/widgets/toolbar.dart
  4. 4
      lib/src/widgets/toolbar/quill_font_family_button.dart
  5. 3
      lib/src/widgets/toolbar/quill_font_size_button.dart

@ -42,8 +42,6 @@ abstract class EditorState extends State<RawEditor>
String get pastePlainText; String get pastePlainText;
bool get liveTextInputEnabled => false;
/// Controls the floating cursor animation when it is released. /// Controls the floating cursor animation when it is released.
/// The floating cursor is animated to merge with the regular cursor. /// The floating cursor is animated to merge with the regular cursor.
AnimationController get floatingCursorResetController; AnimationController get floatingCursorResetController;

@ -1747,6 +1747,10 @@ class RawEditorState extends EditorState
} }
} }
} }
@override
// TODO: implement liveTextInputEnabled
bool get liveTextInputEnabled => false;
} }
class _Editor extends MultiChildRenderObjectWidget { class _Editor extends MultiChildRenderObjectWidget {

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

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

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

Loading…
Cancel
Save