rdev_riverpod_purchases 0.2.4
SDKflutter
Platformandroidios
Manage purchases
Presentation layer
This layer is responsible for the presentation of the RdevRiverpodStoredFile feature. It directly communicates with data layer - repository.
Rules
- try to structure presentation layer in a way that it is easy to understand and navigate, for example move pages, forms, widgets to separate folders.
- make sure that name of the file reflects class you extending from
- unless its really necessary (ie ask first), try to avoid creating statefull widgets, if you need to keep state use ConsumerWidget (check pages for example) and create state using Riverpod pattern (_controller.dart file)
Widgets (dumb)
- I call them dumb widgets, because they should only think about themselves and know nothing about the rest of the app
- they should use parameters (or VOs) and callbacks to communicate with the rest of the app
- they should not have any state
- they should not have any magic numbers/constants
- they should be localized
- they should be tested
- if you plan to reuse them more then twice, consider moving them to
UIfeature
Pages
- should always extend
ConsumerWidgetclass - should define
controllerlogic in separate file usingRiverpodpattern - should keep
controllerandstateaccess inbuildmethod - every
actionfrom UI should be handled incontrollerand not inbuildmethod - ideally we should not use other
Riverpodprovider inbuildmethod, BUT I am flexible with it, as long as it make sense. (not related to feature, and it should not be handled by REPO)