Tarmslitaren / FrosthavenAssistant

flutter app
GNU Affero General Public License v3.0
182 stars 45 forks source link

refactor(CharacterSelectMenu) Pull character list tile into it's own widget #222

Closed nicholaskillin closed 2 months ago

nicholaskillin commented 3 months ago

What is this

This is a refactor I did to help get myself familiar with the codebase. It does not change any functionality. It does 2 things:

  1. Pulls the ListTile for a character in the character select menu out into it's own widget
  2. Takes some of the things we did repeatedly in that widget and pulls them into a var.

Why?

Pulling these things out into variables should do a few things for us:

  1. Makes things a little easier to read by giving them a meaningful name.
  2. Gives us 1 spot in the code to tweak these should they ever need tweaked.
  3. For the variables storing the return value of a function, it allows us to just run those calculations once instead of multiple times per character.

Notes

This is by no means necessary. Again, we don't really gain any user facing benefits here, this was more for me (and other developers) to help make this bit of code just a tad easier to read.

I'm new to Flutter and happy to make changes/learn as I go. Please feel free to leave helpful suggestions or point me in the right direction if something I've done doesn't follow best practices or your preferences.