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

Customize pickedItems display #23

Closed
anqit opened this issue Jan 31, 2023 · 5 comments
Closed

Customize pickedItems display #23

anqit opened this issue Jan 31, 2023 · 5 comments

Comments

@anqit
Copy link
Contributor

anqit commented Jan 31, 2023

I think it would be neat to be able to customize certain aspects of the display. In particular, I would like to provide a custom widget to show the picked items.

@esentis
Copy link
Owner

esentis commented Jan 31, 2023

Interesting, so you would like to provide your own Widget that will accomodate the pickedItemBuilder, can you give me a visual or code example ?

@anqit
Copy link
Contributor Author

anqit commented Jan 31, 2023

I don't have a visual yet, but I'd like to show the picked users in a single, horizontally scrolling ListView, which I don't think is possible at the moment? I could be wrong though. I don't mind taking a stab at a PR for it myself when I get a chance to do so

@esentis
Copy link
Owner

esentis commented Jan 31, 2023

Cool, I'll look into it if I can expose the picked items container, in a builder function. You're right currently this is not available.

@esentis
Copy link
Owner

esentis commented Jan 31, 2023

Ok I think we are done here, I have added a new parameter pickedItemsContainerBuilder you can see below an example with the outcome.

pickedItemsContainerBuilder: (pickedItems) => Center(
    child: Container(
    height: 150,
    width: 150,
    decoration: BoxDecoration(
        border: Border.all(color: Colors.grey[400]!),
      ),
    child: ListView(
        children: pickedItems,
    ),
  ),
),
pickedItemBuilder: (country) {
    return Padding(
    padding: const EdgeInsets.all(8),
    child: Center(
        child: Text(
        country.name,
        style: const TextStyle(
            color: Colors.blue,
            decoration: TextDecoration.underline,
        ),
      ),
    ),
  );
},

@anqit
Copy link
Contributor Author

anqit commented Jan 31, 2023

Looks great, thanks for the quick update!

esentis added a commit that referenced this issue Mar 5, 2023
* ♻️ 🎨 Improves structure & refactors methods

* 📝 Documents changes

* ⬆️ Bumps version to 2.3.6

* call remove once; other small fixes (#22)

* 📝 Updates CHANGELOG

* ✨ Adds pickedItemsContainerBuilder

Closes #23

* ⬆️ Bumps version to 2.3.7

* 📝 Documents changes

* Allow setting controllers and a couple other customizations (#24)

* providable nodes and controllers

* customize hint text and allow clearing field

* undo input decoration

* use custom picked items builder for empty lists also

* re-add custom input decoration

* ⬆️ Bumps version to 2.4.0

* 📝 Documents changes

* 🤡 Tweaks example code

* 💥 ✨ Refactors showed items with lazy loading

* 🐛 Adds missed shrinkwrap

* ⬆️ Bumps version to 2.4.1

* 📝 Documents changes

* fix short-circuiting due to dart-lang/language#2864 (#25)

* Avoid unnecessary fuzzy search (#26)

* fix short-circuiting due to dart-lang/language#2864

* update operator

turns out the "double" version of the operators does short-circuit

* Revert "Avoid unnecessary fuzzy search (#26)" (#27)

This reverts commit 7aaed22.

* ⬆️ Bumps version to 2.4.2

* 📝 Updates CHANGELOG

* fix: outerContainerColor (#28)

* fix: outerContainerColor

* fix: outerContainerDecoration

* ⬆️ Bumps version to 2.4.3

* 📝Updates CHANGELOG

* 🐛 Resolves decoration discrepancies

---------

Co-authored-by: anqit <anqit.praqash@gmail.com>
Co-authored-by: Julia Bulgakova <37380842+Luvti@users.noreply.github.com>
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