Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying themes to the entire formBuilder #242

Closed
moda20 opened this issue Mar 12, 2020 · 5 comments
Closed

Applying themes to the entire formBuilder #242

moda20 opened this issue Mar 12, 2020 · 5 comments
Labels
solved A solution for this issue had been found

Comments

@moda20
Copy link

moda20 commented Mar 12, 2020

hey I am trying to apply a theme, basically a set of textStyles, buttons styles, ... to the entire formBuilder widget and the items in it.

I could go on and add InputDecorations like follow to all widgets but that would be non efficient :

decoration: InputDecoration(
                            labelText: "Stepper",
                            labelStyle: TextStyle(
                                color: Colors.white
                            )
                        )

Is applying a global theme possible and how to do it if true.

@rnvitter
Copy link

I was wondering the same thing

@sharpsan
Copy link

Theme(
theme: Theme.of(context).copyWith(
//Your theme changes
);
):

@danvick
Copy link
Collaborator

danvick commented Mar 27, 2020

Hi @moda20 / @rnvitter,
This looks like a sound idea.

However, are you aware that you can set a system-wide InputDecoration theme in your MaterialApp like so:

MaterialApp(
  theme: ThemeData(
    inputDecorationTheme: InputDecorationTheme(
      labelStyle: TextStyle(color: Colors.white),
    ),
  ),
  ...
)

@danvick
Copy link
Collaborator

danvick commented Mar 27, 2020

I'll consider adding a form-wide input decoration theme if this issue gets enough upvotes. In the meantime, my suggestion is to use InputDecorationTheme as shown above.

@sharpsan
Copy link

I'll consider adding a form-wide input decoration theme if this issue gets enough upvotes. In the meantime, my suggestion is to use InputDecorationTheme as shown above.

I think wrapping the form builder in a Theme widget or using the suggestion described above is adequate.

For further modifications, we can make our own components and directly control the UI through the conponent's renderer.

@danvick danvick added the solved A solution for this issue had been found label May 1, 2020
@danvick danvick closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved A solution for this issue had been found
Projects
None yet
Development

No branches or pull requests

4 participants