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

FormBuilderSlider does not show up #80

Closed
yehee opened this issue Jun 18, 2019 · 3 comments
Closed

FormBuilderSlider does not show up #80

yehee opened this issue Jun 18, 2019 · 3 comments

Comments

@yehee
Copy link

yehee commented Jun 18, 2019

I started with the example snippet of code from README, and it does not seem to be working. So, I am wondering if I'm missing some dependencies/attributes in order to use it correctly.
Here is the code I have in my project:

final GlobalKey<FormBuilderState> _fbKey = GlobalKey<FormBuilderState>();
...
FormBuilder(
  key: _fbKey,
  autovalidate: true,
  child: Column(
    children: <Widget>[
      ...
      FormBuilderSlider(
        attribute: "slider",
        min: 0.0,
        max: 10.0,
        initialValue: 7.0,
        divisions: 20,
        decoration: InputDecoration(
          labelText: "Number of somethings",
          fillColor: themeColor,
        ),
      ),
      ...
    ],
  ),
)

Currently, the code is compiling and I do not get any errors in the log. However, I do not see the slider part of the form. It is only invisible; I can still drag the 'invisible' slider around to change the value:
20190618164629

Dependencies in pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  charts_flutter: 0.6.0
  flutter_xlider: 2.4.3
  flutter_email_sender: 2.0.3
  url_launcher: ^5.0.3
  flutter_form_builder: 3.2.0
  cupertino_icons: ^0.1.2

Let me know if you need any other information or clarification. Thanks in advance!

@danvick
Copy link
Collaborator

danvick commented Jun 22, 2019

Hi Alice,
Sorry for the late response.
Is there any chance that your primary color is white?
The color of the slider usually takes the app's theme primaryColor

@danvick
Copy link
Collaborator

danvick commented Jun 22, 2019

Thanks to this issue that you have raised, I have noticed some missing bits in the package which have been fixed as of v3.2.1. Feel free to try it out.
You can now change your activeColor and inactiveColor of the Slider widget.

Your contribution is appreciated, Alice.

@yehee
Copy link
Author

yehee commented Jun 23, 2019

You're right. The primaryColor is set to Colors.white. Thank you so much for your time, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants