MarkdownEditorThemeData.fromTheme constructor
MarkdownEditorThemeData.fromTheme(
- ThemeData theme
Builds editor styling from the ambient Flutter theme.
Implementation
factory MarkdownEditorThemeData.fromTheme(ThemeData theme) {
final primary = theme.colorScheme.primary;
return MarkdownEditorThemeData(
toolbarColor: theme.colorScheme.surface,
toolbarActiveIconColor: primary,
toolbarActiveBackgroundColor: primary.withOpacity(0.12),
dividerColor: theme.dividerColor.withOpacity(0.6),
searchBarColor: theme.colorScheme.surfaceVariant.withOpacity(0.35),
suggestionPanelColor: theme.colorScheme.surface,
suggestionSelectedBackgroundColor: primary.withOpacity(0.12),
selectionColor: primary.withOpacity(0.12),
dropTargetColor: primary.withOpacity(0.08),
dropTargetBorderColor: primary.withOpacity(0.65),
blockBorderColor: theme.dividerColor.withOpacity(0.55),
blockHeaderColor: theme.colorScheme.surfaceVariant.withOpacity(0.35),
tableBorderColor: theme.dividerColor.withOpacity(0.55),
tableHeaderColor: theme.colorScheme.surfaceVariant.withOpacity(0.25),
tableSelectionColor: primary.withOpacity(0.12),
tableActiveBorderColor: primary.withOpacity(0.45),
editorBorderRadius: 8,
toolbarButtonRadius: 6,
blockBorderRadius: 8,
contentPadding: const EdgeInsets.all(16),
sourcePadding: const EdgeInsets.all(16),
previewPadding: const EdgeInsets.all(16),
blockPadding: const EdgeInsets.all(12),
tablePadding: const EdgeInsets.all(12),
);
}