DevWidgets icon indicating copy to clipboard operation
DevWidgets copied to clipboard

Make the text editor theme respect the user's theme on first time

Open qrhfz opened this issue 3 years ago • 3 comments

image

qrhfz avatar Dec 12 '22 06:12 qrhfz

Oh, user needs to change Text Editor Theme also.

qrhfz avatar Dec 12 '22 06:12 qrhfz

Thanks for the issue! I will develop the following solution: When the user open the app on the first time, I will default the text editor theme to the user theme, but after that, the user can override both app and editor theme.

gumbarros avatar Dec 12 '22 11:12 gumbarros

I'm sorry @qrhfz, I will leave this issue open because I have an impediment. As a workaround, you can just set your text editor theme at settings.

To get the user theme settingsProvider would need BuildContext. image To use the context here:

      textEditorTheme: _settingsBox.get("textEditorTheme",
          defaultValue: Theme.of(context).brightness == Brightness.dark
              ? "vs2015"
              : "vs"),

If anyone with Riverpod knowledge knows how to access the BuildContext inside a Provider, I will be grateful. I will just set the default theme to vs2015, because the majority of developers use dark theme.

gumbarros avatar Dec 12 '22 12:12 gumbarros