Disco Tray Week 3 Post
This week I was mostly still working on the same issue. I am trying to load images when you go to the admin page and attempt to edit a site's images. Previously, images simply would not show up. Last week I tried to use listeners to tell the dialog to rebuild when the images had loaded in from appstate. For whatever reason, I simply could not get that to work. Instead, I used a future builder to load them independently from appstate if the images were not already loaded in. This solution was not my first choice, but it does work and I am avoiding all the issues I was having with the listener solution. There are a few details of this solution that were difficult to figure out, such as an error stating an animation listener had been deleted. I am not sure why that error was displayed since the actual source of the error had nothing to do with animation. But it is all working now, so I am very thankful
Additionally, I went through all of the code and changed the way appstate is passed from page to page. Previously, we would pass appstate within constructors. However, Flutter's documentation is in favor of using the Provider.of method so I changed to that in the vain hope that would make my listener solution work. I think that this solution is much better than passing appstate around, and I noticed that appstate would actually be initialized multiple times during the app. Now it is initialized once and I think everything loads just a little bit quicker.
Finally, I also worked on the Hendrix Today app. This app was much simpler to look at the code for. It was clearly created by someone who knew how flutter worked from the creaton of the app to the current state it is in now. I would like to go back and change the code in Faulkner Footsteps to be this clean and readable. The issue I was working on was about the searchbar for the list page. Professor Goadrich was concerned that the textfield was taking up too much room on the list page. To accomplish this, I made the search icon on the textfield into a button icon that would change flip a boolean value. This boolean value would control whether or not the textfield was visible. I added an AnimatedSwitcher as well to animate it appearing and disappearing so that it would not feel so sudden. I think this is a good solution, perhaps there is a way to make it disappear when the user starts scrolling down the list. That may make a good addition or it might be clunky. I will ask Professor Goadrich if he wants me to try that or if he likes what I currently have.
Hopefully after our meeting today Dylan and I will have a good verison of Faulkner Footsteps that we can use to start testing with real users.