🏯 禅文 Zenwen Day 6 & 7 (I swear that isn’t on purpose)
TL;DR
- Finished My Dictionary; now there’s a master list of all your vocab! Great for if you want to see your progress or just forget a word.
- Starded working on a search bar!
- Worked on making my computer less laggy (no time logged for this)
The Search Bar
What’s the point in being able to make a bunch of decks and vocab if it takes too long to find them? Exactly, there is none.
Today I started working on adding a search bar to the header of the app.
Surprisingly, the logic behind it is pretty simple. Just iterate through the Maps and Lists. If an item matches your search, add it to a results Map.
What I Learned
You know those simple, boring headers at the top of basically every app?
That’s what us Flutter devs call an AppBar.
Apparently, AppBars have multiple parts:
- leading
- title (already knew about this one)
- trailing
- actions
- bottom
The bottom is what I use for the search bar. Essentially, the bottom is an extension of widgets that are below the title.
In order to make it work, you need to give the Scaffold (the parent of the AppBar) specific details about the extension so that it renders properly. Specifically the height, which can’t be dynamic.
🀄 Since you made it this far
Chinese word of the day: 吗 (pronounced “ma”)
- used to turn a statement into a yes or no question
- 你喜欢茶: You like tea.
- 你喜欢茶吗: Do you like tea?
Comments 2
this is really cool!!
@kai_ling thanks!
Sign in to join the conversation.