Skip to content

Commit

Permalink
[SuperEditor] - Apply componentBuilders to SuperEditor widget from pl…
Browse files Browse the repository at this point in the history
…ugins (#2366)
  • Loading branch information
JostSchenck authored and matthew-carroll committed Oct 9, 2024
1 parent c1831b3 commit d73f68c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions super_editor/lib/src/default_editor/super_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ class SuperEditor extends StatefulWidget {
this.shrinkWrap = false,
}) : stylesheet = stylesheet ?? defaultStylesheet,
selectionStyles = selectionStyle ?? defaultSelectionStyle,
componentBuilders = componentBuilders != null
? [...componentBuilders, const UnknownComponentBuilder()]
: [...defaultComponentBuilders, TaskComponentBuilder(editor), const UnknownComponentBuilder()],
componentBuilders = [
for (final plugin in plugins) ...plugin.componentBuilders,
if (componentBuilders != null)
...componentBuilders
else ...[...defaultComponentBuilders, TaskComponentBuilder(editor)],
const UnknownComponentBuilder(),
],
super(key: key);

/// [FocusNode] for the entire `SuperEditor`.
Expand Down

0 comments on commit d73f68c

Please sign in to comment.