gumbarros / DevWidgets

DevWidgets is a Flutter application with several tools such as generators, formatters and converters for developers. It's directly inspired by DevToys.
https://gumbarros.github.io/DevWidgets
MIT License
153 stars 13 forks source link

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

Open qrhfz opened 1 year ago

qrhfz commented 1 year ago

image

qrhfz commented 1 year ago

Oh, user needs to change Text Editor Theme also.

gumbarros commented 1 year ago

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 commented 1 year ago

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.