Comments (6)
in order to find out how many are selected and change items based on it try this
onPressed: (item) {
item.active ? selected++ : selected--;
if (selected == 4 && item.active) {
item.active = false;
selected --;
}
},
from flutter_tags.
when set item.active = false; say "active" can't be setter, because it is final
from flutter_tags.
I hope that when I choose a certain number of labels, then I can’t choose other. How can I achieve them?
from flutter_tags.
@bingweibi that's the same thing I want to ask and @SamadiPour as you mentioned item.active = false but it can't be possible because it is mentioned final in plugin if I changed that code in plugin and remove final from it still it is not changing the status of active item to inactive
from flutter_tags.
@divyankvijayvergiya yeah i was wrong and i don't know any other way :(
from flutter_tags.
As said Item class has this field active which is final else we can change it's value even the user press on it to limit selecting i'm having the same issue
from flutter_tags.
Related Issues (20)
- Can I set a different color for each tag?
- Preserve the scroll position between tabs (so, after a widget rebuid) HOT 4
- Allow deselection of a tag when singleItem is true HOT 2
- Programatically select a tag during build and trigger onPressed event HOT 7
- Add possibility to pass textController HOT 2
- Custom Validation while inserting Tags
- Override default onPressed callback
- Keep focus after submit HOT 3
- type 'Null' is not a subtype of type 'DataList' in type cast HOT 15
- Several Issues, and feature request HOT 3
- Tags' is defined in the libraries 'package:flutter_tags/src/tags.dart
- Add support for null-safety HOT 2
- There is no way to change the tag inActive color HOT 1
- No automatic scrolling into the right after adding a new tag
- Too many errors in the new null safety version, corrected some but please correct all and republish HOT 2
- Null safe Alternative HOT 1
- expose textfield controller
- Upgrade to Flutter 3 HOT 1
- Is it possible to customize close button place?
- Is this package deprecated? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_tags.