format code

pull/817/head
li3317 3 years ago
parent 5097e86b76
commit 0a9a6c9625
  1. 4
      lib/src/models/themes/quill_custom_icon.dart
  2. 3
      lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart
  3. 21
      lib/src/widgets/toolbar.dart

@ -1,9 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class QuillCustomIcon { class QuillCustomIcon {
const QuillCustomIcon( const QuillCustomIcon({this.icon, this.onTap});
{this.icon,
this.onTap});
///The icon widget ///The icon widget
final IconData? icon; final IconData? icon;

@ -81,8 +81,7 @@ mixin RawEditorStateSelectionDelegateMixin on EditorState
scrollController.jumpTo(targetOffset.offset); scrollController.jumpTo(targetOffset.offset);
} }
renderEditor.showOnScreen(rect: targetOffset.rect); renderEditor.showOnScreen(rect: targetOffset.rect);
} catch (_) { } catch (_) {}
}
} }
// Finds the closest scroll offset to the current scroll offset that fully // Finds the closest scroll offset to the current scroll offset that fully

@ -176,7 +176,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
toolbarSectionSpacing: toolbarSectionSpacing, toolbarSectionSpacing: toolbarSectionSpacing,
toolbarIconAlignment: toolbarIconAlignment, toolbarIconAlignment: toolbarIconAlignment,
multiRowsDisplay: multiRowsDisplay, multiRowsDisplay: multiRowsDisplay,
customIcons: customIcons, customIcons: customIcons,
locale: locale, locale: locale,
children: [ children: [
if (showUndo) if (showUndo)
@ -475,15 +475,14 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
endIndent: 12, endIndent: 12,
color: Colors.grey.shade400, color: Colors.grey.shade400,
), ),
for (var customIcon in customIcons) for (var customIcon in customIcons)
QuillIconButton( QuillIconButton(
highlightElevation: 0, highlightElevation: 0,
hoverElevation: 0, hoverElevation: 0,
size: toolbarIconSize * kIconButtonFactor, size: toolbarIconSize * kIconButtonFactor,
icon: Icon(customIcon.icon, size: toolbarIconSize), icon: Icon(customIcon.icon, size: toolbarIconSize),
borderRadius:iconTheme?.borderRadius ?? 2, borderRadius: iconTheme?.borderRadius ?? 2,
onPressed: customIcon.onTap onPressed: customIcon.onTap),
),
], ],
); );
} }
@ -508,7 +507,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
/// List of custom icons /// List of custom icons
final List<QuillCustomIcon> customIcons; final List<QuillCustomIcon> customIcons;
@override @override
Size get preferredSize => Size.fromHeight(toolbarHeight); Size get preferredSize => Size.fromHeight(toolbarHeight);

Loading…
Cancel
Save