darwingr / xmoves

Quarantine inspired healthy activities app for Kennedy Nangle, 2020 micro-grant recipient from StFX's Frank McKenna Centre for Leadership
https://www.xmoves.ca
Other
0 stars 0 forks source link

Constructing Usecase object may initialize infrastructure resources #8

Open darwingr opened 3 years ago

darwingr commented 3 years ago

Issues

Under Build # 4

darwingr commented 3 years ago

Solution 1 (used):

Calls WidgetsFlutterBinding.ensureInitialized() in main before repositories are initialized.

Solution 2 (preventative):

Make the _fetchCSVRows property into a getter to a memoized value. The respective factories will store only a function that will be used to memoized when later accessed. Thus deferring the construction and use of the AssetBundle until the calling repository actually has its own methods called.