0

if I have 100k data in json and I want to use it in multiselect in flutter app how would I do using search only?

[
  {
     "id": 16905,
     "name": "5-HTP"
    },
    {
     "id": 16906,
     "name": "5-hydroxytryptophan"
    },
    {
     "id": 16907,
     "name": "60 Second Fluoride Gel"
    },
    {
     "id": 16908,
     "name": "60-Second Fluoride Foam"
    },
    {
     "id": 16909,
     "name": "7T Gummy ES Chewable Tablets"
    },
    {
     "id": 16910,
     "name": "8 in 1 Ultra Care"
    },
]
James Z
  • 12,209
  • 10
  • 24
  • 44
  • I want to use it efficiently without any future delay or don't want to load data at once. – Shadman Nehal Khan Aug 03 '22 at 05:50
  • Could you please better explain your question. And bare searching through this much data linearly will be lot slow, it will lead to getting your app freeze while you are searching through json dict – Anonymous Atom Aug 03 '22 at 05:50
  • Are you accessing data from firebase? – Anonymous Atom Aug 03 '22 at 05:52
  • No I have stored it in assets folder , till now my data is 20k which makes it slow to load but somehow I managed by adding loader for that but in future if I need to load 1 Lakh data or more than that then It would be difficult for me to implement the same. – Shadman Nehal Khan Aug 03 '22 at 05:56
  • No, that's not right way to store and fetch data. That's will freeze your app for sure. You will have to store data in some other cloud source. Reffer here https://stackoverflow.com/questions/59873000/how-can-i-access-json-object-using-flutter – Anonymous Atom Aug 03 '22 at 05:58
  • @AnonymousAtom If I fetch data this way then I wanted to ask is there any multi select which fetches the data into the list only when searched not all at once ? – Shadman Nehal Khan Aug 03 '22 at 06:04
  • Please avoid using words like *lakh* that are not globally understood. – James Z Aug 03 '22 at 09:12
  • thanks will take care of that. – Shadman Nehal Khan Aug 04 '22 at 10:38

0 Answers0