How can I create a list with letters as headers? - flutter

I want to make a list of currencies in alphabetical order with letters as headers. Please have a look at the pictures for better understanding.
This is what I want to achieve
The list I have been able to achieve so far (A simple one)
I searched for packages but I couldn't find anything as per my need. Your help would be much appreciated.
Thanks.

Sounds like: how to implement Alphabet scroll in flutter
another options is: You can make a Map for example
countriesDict = {"a" : {"Algeria, Andorra", "b" : {"Bolivia, Bosnia ...."}}}
and retrieve it it in your code. For example:
for (country in countriesDict) {
... Your code to sort it out
}
and then display it.

You can use this package to implement your desired result easily.
Grouped List
Rest of it depends on your design.

Related

Filter pokeApi on pokemon name

I have a question about the PokeApi that you can find here : https://pokeapi.co/
I just wanted to know if this possible to filter the api by the name of the pokemons starting with a certain letter.
Like for example get the 20 first pokemons that start with the letter "p".
I searched online but can't find any project that use filters like that so that's why Im asking there.
Thank you in advance.

How can you filter search by matching String to a field in Algolia?

I'm trying to create filters for a search on an Android app where a specific field in Algolia must exactly match the given String in order to come up as a hit. For example if Algolia has a field like "foo" and I only want to return hits where "foo" is equal to "bar", then I would expect that I would have to use a line of code like this:
query.setFilters("foo: \"bar\"");
Any guesses as to why this isn't working like I see in the examples or how to do so?
Ah, I thought that attributesForFaceting was done by setting what was searchable or not. It was on a different page within the dashboard than I was previously using. Thanks #pixelastic.

Extract text from a Wordnik API URL in Google Sheets

Can anyone explain how to import/extract a particular field from the following url into Google Sheets:
Wordnik URL
I'm guessing there is an IMPORTXML query that could do it, but it doesn't have the nodes that IMPORTXML usually uses to import that. Instead the code looks like this:
[{"mi":6.720745180909532,"gram1":"pretty","gram2":"much","wlmi":18.953166108085608},{"mi":6.650496643050408,"gram1":"pretty","gram2":"good","wlmi":18.469078820531266},{"mi":9.839004198061549,"gram1":"pretty","gram2":"darn","wlmi":17.298435816698845},{"mi":7.515791105774376,"gram1":"pretty","gram2":"cool","wlmi":15.515791105774376},{"mi":8.233704272151307,"gram1":"pretty","gram2":"impressive","wlmi":15.210984195651225}]
So if Cell A2 has the URL that produces this as the code, how do I get B2 to give me the text after "gram2" (in this case, "good", "darn", "cool" and "impressive").
Thanks
Tardy
I've come up with a workaround but it is kind of messy. I'd still like an answer to the question, but for reference and in case it's of use to anyone I'll post it here:
Using =IMPORTDATA(E10) (where E10 is the cell with the URL in) gave me an array (I guess based on .csv principles) that I could then manipulate using some other tools, like regexreplace, to get at the relevant bits of text.

Returning the number of results?

I'm looking to return the number of results found in an ajax fashion on Algolia instant search.
A little field saying something like "There are X number of results" and refines as the characters are typed.
I've read you utilise 'nbHits' but i'm unsure of how to go about it.. Being from a design background.
Thanks for help in advance.
The instantsearch.js stats widget shows the number of results and speed of the search. If you don't want to use the widget, I believe you can still use {{nbHits}} inside of your template wherever you want the number to print.
Very easy when you know how, Thanks for pointing me in the right direction Josh.
This works:
search.addWidget(
instantsearch.widgets.stats({
container: '.no-of-results'
})
);

Django-Tastypie filter all fields

I'm doing a project with django-tastypie and know how to set a field to filter by, thus:
filtering = {
'nationality': ALL,
}
What I want to know is if there was some setting that would allow me to have all the fields available for filtering, without having to be set one by one as in the example above?
Someone can help me?
Unfortunately, I Don't think there is a way to do it at once.
You can use this way,
for field in YourModel.__dict__['_meta'].fields:
filtering.update({field.name : ALL})