mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 18:03:14 +08:00
DarkMode: Improve markdown code blocks color
Flutter_markdown has hardcoded certain grey colors. This doesn't go well with a dark theme. For now we're overwriting it.
This commit is contained in:
@ -181,6 +181,26 @@ class NoteViewer extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Copied from MarkdownStyleSheet except Grey is replaced with Highlight color
|
||||||
|
var markdownStyleSheet = MarkdownStyleSheet.fromTheme(theme).copyWith(
|
||||||
|
code: theme.textTheme.body1.copyWith(
|
||||||
|
backgroundColor: theme.dialogBackgroundColor,
|
||||||
|
fontFamily: "monospace",
|
||||||
|
fontSize: theme.textTheme.body1.fontSize * 0.85,
|
||||||
|
),
|
||||||
|
tableBorder: TableBorder.all(color: theme.highlightColor, width: 0),
|
||||||
|
tableCellsDecoration: BoxDecoration(color: theme.dialogBackgroundColor),
|
||||||
|
codeblockDecoration: BoxDecoration(
|
||||||
|
color: theme.dialogBackgroundColor,
|
||||||
|
borderRadius: BorderRadius.circular(2.0),
|
||||||
|
),
|
||||||
|
horizontalRuleDecoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
top: BorderSide(width: 5.0, color: theme.highlightColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
var view = SingleChildScrollView(
|
var view = SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -192,7 +212,7 @@ class NoteViewer extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
|
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
|
||||||
child: MarkdownBody(
|
child: MarkdownBody(
|
||||||
data: note.body,
|
data: note.body,
|
||||||
styleSheet: MarkdownStyleSheet.fromTheme(theme),
|
styleSheet: markdownStyleSheet,
|
||||||
onTapLink: (String link) {
|
onTapLink: (String link) {
|
||||||
print("Launching " + link);
|
print("Launching " + link);
|
||||||
launch(link);
|
launch(link);
|
||||||
|
Reference in New Issue
Block a user