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

Customizing SmartSelectOption #7

Closed
antonbt opened this issue Mar 30, 2020 · 3 comments
Closed

Customizing SmartSelectOption #7

antonbt opened this issue Mar 30, 2020 · 3 comments

Comments

@antonbt
Copy link

antonbt commented Mar 30, 2020

Such a feature rich package. Thanks! However, it would be nice to be able to customize each list option. Why not implement a child parameter or make the required title parameter accept a type of Widget instead of just a String.

@davigmacode
Copy link
Owner

Hey Thanks for using this package, hope will help a lot.

Title must be a String because it also used in comparison with search text.

You should try use choiceConfig option, it has a lot of option to create custom builder:

@sklorde
Copy link

sklorde commented Aug 24, 2020

Using choiceConfig i can't change the value of the checkbox... do you have any tips?
And, what's the param "null" inside onChange(null, bool) function?

choiceConfig: SmartSelectChoiceConfig(
                useDivider: true,
                builder: (item, checked, onChange) {
                  return Container(
                    height: 55,
                    child: Padding(
                      padding: EdgeInsets.only(left: 20),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            item.title,
                            style: TextStyle(
                              fontSize: 15,
                            ),
                          ),
                          if (item.subtitle != 'Produto em falta')
                            Row(
                              children: [
                                Text(
                                  '+ ${item.subtitle}',
                                  style: TextStyle(
                                    fontSize: 15,
                                    color: Colors.green,
                                  ),
                                ),
                                Checkbox(
                                  value: checked,
                                  onChanged: (value) {
                                    onChange(null, value);
                                  },
                                )
                              ],
                            )
                          else
                            Container(),
                        ],
                      ),
                    ),
                  );
                },
              ),

@vasilich6107
Copy link

I released https://pub.dev/packages/flutter_awesome_select with fixed null safety.
Could you check that everything works for you?

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

4 participants