-
-
Notifications
You must be signed in to change notification settings - Fork 15
Searchable materials #79
base: master
Are you sure you want to change the base?
Conversation
It looks like I could pretty easily implement this for the Bank > Bank tab as well, and maybe the character inventory. However, I've never touched Flutter before other than a tutorial so I figured I'd stop with Materials and wait for feedback first. Definitely open to constructive criticism |
Thanks for the pull request, the implementation looks good! class SearchPage extends StatefulWidget {
final Widget Function(BuildContext, String) builder;
SearchPage({
@required this.builder
});
@override
_SearchPageState createState() => _SearchPageState();
}
class _SearchPageState extends State<SearchPage> {
String _search = "";
@override
Widget build(BuildContext context) {
// Use widget.builder(context, _search) inside the body
}
} You can then open the SearchPage when the user presses a search icon in the AppBar of for example the BankPage: Navigator.of(context).push(MaterialPageRoute(
builder: (context) => SearchPage(
builder: (context, search) => // Return the items filtered by the search string
)
)) Let me know if you would like to implement something like that, or if you have any other suggestions :) |
That seems like a good idea, I'll give that a whirl |
Pretty much just copied what you wrote 😃 |
I've taken a quick look but haven't had time to get it done quite yet 🙂 Looks like I'll probably end up modifying some of the existing page/appbar constructors to do this, but not entirely sure yet. An entirely new page that wraps some of the existing utilities might just work better. |
Adds a search bar to the Bank > Materials page, that updates the displayed items as the search is changed. Materials categories that are empty after the search filter are hidden.
Related Issue
#76
How Has This Been Tested?
Manual testing on a Pixel 5 (see recording).
Screen recording: