|
@@ -40,15 +40,18 @@ class EditorStyleCustomizer {
|
|
color: theme.colorScheme.onBackground,
|
|
color: theme.colorScheme.onBackground,
|
|
height: 1.5,
|
|
height: 1.5,
|
|
),
|
|
),
|
|
- bold: baseTextStyle(fontFamily).copyWith(
|
|
|
|
|
|
+ bold: baseTextStyle(fontFamily, fontWeight: FontWeight.bold).copyWith(
|
|
fontWeight: FontWeight.w600,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
- italic: baseTextStyle(fontFamily).copyWith(fontStyle: FontStyle.italic),
|
|
|
|
- underline: baseTextStyle(fontFamily)
|
|
|
|
- .copyWith(decoration: TextDecoration.underline),
|
|
|
|
- strikethrough:
|
|
|
|
- baseTextStyle(fontFamily)
|
|
|
|
- .copyWith(decoration: TextDecoration.lineThrough),
|
|
|
|
|
|
+ italic: baseTextStyle(fontFamily).copyWith(
|
|
|
|
+ fontStyle: FontStyle.italic,
|
|
|
|
+ ),
|
|
|
|
+ underline: baseTextStyle(fontFamily).copyWith(
|
|
|
|
+ decoration: TextDecoration.underline,
|
|
|
|
+ ),
|
|
|
|
+ strikethrough: baseTextStyle(fontFamily).copyWith(
|
|
|
|
+ decoration: TextDecoration.lineThrough,
|
|
|
|
+ ),
|
|
href: baseTextStyle(fontFamily).copyWith(
|
|
href: baseTextStyle(fontFamily).copyWith(
|
|
color: theme.colorScheme.primary,
|
|
color: theme.colorScheme.primary,
|
|
decoration: TextDecoration.underline,
|
|
decoration: TextDecoration.underline,
|
|
@@ -87,8 +90,7 @@ class EditorStyleCustomizer {
|
|
italic: baseTextStyle(fontFamily).copyWith(fontStyle: FontStyle.italic),
|
|
italic: baseTextStyle(fontFamily).copyWith(fontStyle: FontStyle.italic),
|
|
underline: baseTextStyle(fontFamily)
|
|
underline: baseTextStyle(fontFamily)
|
|
.copyWith(decoration: TextDecoration.underline),
|
|
.copyWith(decoration: TextDecoration.underline),
|
|
- strikethrough:
|
|
|
|
- baseTextStyle(fontFamily)
|
|
|
|
|
|
+ strikethrough: baseTextStyle(fontFamily)
|
|
.copyWith(decoration: TextDecoration.lineThrough),
|
|
.copyWith(decoration: TextDecoration.lineThrough),
|
|
href: baseTextStyle(fontFamily).copyWith(
|
|
href: baseTextStyle(fontFamily).copyWith(
|
|
color: theme.colorScheme.primary,
|
|
color: theme.colorScheme.primary,
|
|
@@ -163,10 +165,14 @@ class EditorStyleCustomizer {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- TextStyle baseTextStyle(String fontFamily) {
|
|
|
|
|
|
+ TextStyle baseTextStyle(
|
|
|
|
+ String fontFamily, {
|
|
|
|
+ FontWeight? fontWeight,
|
|
|
|
+ }) {
|
|
try {
|
|
try {
|
|
return GoogleFonts.getFont(
|
|
return GoogleFonts.getFont(
|
|
fontFamily,
|
|
fontFamily,
|
|
|
|
+ fontWeight: fontWeight,
|
|
);
|
|
);
|
|
} on Exception {
|
|
} on Exception {
|
|
return GoogleFonts.getFont('Poppins');
|
|
return GoogleFonts.getFont('Poppins');
|
|
@@ -174,6 +180,7 @@ class EditorStyleCustomizer {
|
|
}
|
|
}
|
|
|
|
|
|
InlineSpan customizeAttributeDecorator(
|
|
InlineSpan customizeAttributeDecorator(
|
|
|
|
+ BuildContext context,
|
|
Node node,
|
|
Node node,
|
|
int index,
|
|
int index,
|
|
TextInsert text,
|
|
TextInsert text,
|