1. Show PerDate widgets inside of an PageView
2. Introduce GoRouter so we can intercept back button taps with
BackButtonListener
3. Implement rudimentary navigation
4. Fix bug that still showed a spinner event when the barcode was not
found.
the EnterFoodWidget.
1. Make scanned foods appear in the list of foods
2. Remove Controller for entering food
This commit removes the EnterFoodController that was used to put a
scanned food into the EnterFoodWidget.
This is now unnecessary because scanning a product will be distributed
via the FoodBLoC.
This fixes a bug that was caused by a name containing a comma.
We store the food entries in a csv so logically a comma in the name,
causes the parser to crash.
We fix this, by wrapping the name in quotation marks and writing a new
parser for food entries.
Previously, when you would navigate to a PerDate widget that already
exists on the Navigation stack, a food that is entered will not be
visible when popping to the PerDate widget with the same date.
This is because the state is not updated (the BLoC exists per PerDate
widget, and a change in one widget does not cause firing an event in the previous widget's BLoC).
With this fix, we call setState() and update the entries for the widget
from storage.
Now, an on-the-fly food lookup is created from existing entries on startup. Those entries are used to make suggestions when the user is typing to enter new food entries.