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

Different empty widget when using itemBuilder #60

Open
omidraha opened this issue Mar 26, 2021 · 3 comments
Open

Different empty widget when using itemBuilder #60

omidraha opened this issue Mar 26, 2021 · 3 comments

Comments

@omidraha
Copy link

Currently while using itemBuilder , there is no way to use different default empty widget.

I wish to have itemBuilder as:

          itemBuilder: (BuildContext context, int index) {
              return Icon(
                Icons.star,
                color: Color(0xFFBAC3FE),
              );
            },

But when stars are empty (they are not selected, or they are in default empty states) they be:

          itemBuilder: (BuildContext context, int index) {
              return Icon(
                Icons.star_border,
                color: Color(0xFFBAC3FE),
              );
            },
@sachin-dahal
Copy link

there is another property called ratingWidget which can be used to show different icons when they're in different states [full, half, empty]
Here is a sample,

ratingWidget: RatingWidget(
                full: Icon(Icons.star, color: Colors.amber),
                half: Icon(Icons.check_box, color: Colors.purple),
                empty: Icon(Icons.circle, color: Colors.amber),
              ),

@omidraha
Copy link
Author

omidraha commented Jul 6, 2021

I know about that , but I need to use itemBuilder

I think itemBuilder needs something like this

 itemBuilder: (BuildContext context, int index, Mood mood) {

}

That mood is:

  // Mood.empty
  // Mood.half
  // Mood.full

@xurc
Copy link

xurc commented Feb 20, 2022

Confirm, it would be nice to be able to set a custom empty widget when using a builder. For example, we use a different SVG for each ranking position and now empty positions are displayed filled with a mask, but the design assumes outlines. In the current version, we cannot specify a separate SVG for an empty position.

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

3 participants