Comments (1)
Because our source is a video and we do not wanna go through it over and over again, I did some screenshots as shown below.
Basically, to get this to work, we "only" have to separate UIs and business logic. If some platform dependent API is needed, it should be passed as a parameter and the API should be derivation of API's interface.
On the UI side, all inputs and outputs are provided through the business logic. Because Flutter app needs to be reloaded on each change in order to redraw, it's a good idea to use StreamBulder
, in Angular, there is | async
pipe.
The business logic therefore uses inputs (Sink
), works with (platform dependent) APIs and generates some outputs (Stream
).
To ensure everything will work good, the developers must strictly follow "aggressively pedantic rules":
- Inputs and outputs are simple Streams/Sinks only
- Dependencies must be injectable and platform agnostic
- No platform branching allowed
- Implementation can be whatever you want if you follow the previous rules
And of course, not everything has to have its own BLoC, only "complex enough" component should have one:
- Each "complex enough" component has a corresponding BLoC
- Components should send inputs "as is"
- Components should show outputs as close as possible to "as is"
- All branching should be based on simple BLoC boolean outputs
TL;DR:
- Move bussiness logic to BLoCs
- Keep UI components simple
- Design rules aren't negotiable
I think this is a quite good way and it worth a try. As an output of this project, we may do some review of this BLoC.
from flashcards.
Related Issues (20)
- Create own Theme pallete
- Enhance search HOT 1
- Meeting 5. 11. 2018
- Meeting program 5.11. HOT 1
- Flipcard exercise doesn't load properly first time
- Add card to course's section
- Fix detecting sign in warning HOT 3
- enableSuperMixins is deprecated
- Meeting 12. 11. 2018
- Meeting 19. 11. 2018 HOT 1
- Meeting 25. 11. 2018
- Use flutter_launcher_icons
- Use flutter_after_layout
- Add web user profile
- Add web course's sections
- Add web about page
- Add licences web page
- Fix mobile sign in false positives
- Fix user profile edit
- Url to component move to it's component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashcards.