From 3d07328aab178bc5642791d2f23dbcd87ef58b53 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 6 May 2021 14:25:58 +0200 Subject: [PATCH] Editors: Set background color With Flutter 2, the way the theme has set has changed, so I'm slowly migrating to Flex Color Scheme, and fixing all the widgets that look strange. --- lib/editors/note_body_editor.dart | 4 +++- lib/editors/note_title_editor.dart | 4 +++- lib/editors/org_editor.dart | 7 +++---- lib/editors/raw_editor.dart | 7 +++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/editors/note_body_editor.dart b/lib/editors/note_body_editor.dart index 6c4ea3fb..579301b4 100644 --- a/lib/editors/note_body_editor.dart +++ b/lib/editors/note_body_editor.dart @@ -13,7 +13,8 @@ class NoteBodyEditor extends StatelessWidget { @override Widget build(BuildContext context) { - var style = Theme.of(context).textTheme.subtitle1; + var theme = Theme.of(context); + var style = theme.textTheme.subtitle1; return TextField( autofocus: autofocus, @@ -24,6 +25,7 @@ class NoteBodyEditor extends StatelessWidget { hintText: tr('editors.common.defaultBodyHint'), border: InputBorder.none, isDense: true, + fillColor: theme.scaffoldBackgroundColor, ), controller: textController, textCapitalization: TextCapitalization.sentences, diff --git a/lib/editors/note_title_editor.dart b/lib/editors/note_title_editor.dart index 461fde7d..d0d5d323 100644 --- a/lib/editors/note_title_editor.dart +++ b/lib/editors/note_title_editor.dart @@ -10,7 +10,8 @@ class NoteTitleEditor extends StatelessWidget { @override Widget build(BuildContext context) { - var style = Theme.of(context).textTheme.headline6; + var theme = Theme.of(context); + var style = theme.textTheme.headline6; return TextField( keyboardType: TextInputType.text, @@ -19,6 +20,7 @@ class NoteTitleEditor extends StatelessWidget { hintText: tr('editors.common.defaultTitleHint'), border: InputBorder.none, isDense: true, + fillColor: theme.scaffoldBackgroundColor, ), controller: textController, textCapitalization: TextCapitalization.sentences, diff --git a/lib/editors/org_editor.dart b/lib/editors/org_editor.dart index b658f15d..fc73bf7e 100644 --- a/lib/editors/org_editor.dart +++ b/lib/editors/org_editor.dart @@ -191,10 +191,8 @@ class _NoteEditor extends StatelessWidget { @override Widget build(BuildContext context) { - var style = Theme.of(context) - .textTheme - .subtitle1 - .copyWith(fontFamily: "Roboto Mono"); + var theme = Theme.of(context); + var style = theme.textTheme.subtitle1.copyWith(fontFamily: "Roboto Mono"); return TextField( autofocus: autofocus, @@ -205,6 +203,7 @@ class _NoteEditor extends StatelessWidget { hintText: tr('editors.common.defaultBodyHint'), border: InputBorder.none, isDense: true, + fillColor: theme.scaffoldBackgroundColor, ), controller: textController, textCapitalization: TextCapitalization.sentences, diff --git a/lib/editors/raw_editor.dart b/lib/editors/raw_editor.dart index 4de1a9ff..f3eef423 100644 --- a/lib/editors/raw_editor.dart +++ b/lib/editors/raw_editor.dart @@ -175,10 +175,8 @@ class _NoteEditor extends StatelessWidget { @override Widget build(BuildContext context) { - var style = Theme.of(context) - .textTheme - .subtitle1 - .copyWith(fontFamily: "Roboto Mono"); + var theme = Theme.of(context); + var style = theme.textTheme.subtitle1.copyWith(fontFamily: "Roboto Mono"); return TextField( autofocus: autofocus, @@ -189,6 +187,7 @@ class _NoteEditor extends StatelessWidget { hintText: tr('editors.common.defaultBodyHint'), border: InputBorder.none, isDense: true, + fillColor: theme.scaffoldBackgroundColor, ), controller: textController, textCapitalization: TextCapitalization.sentences,