Hello! My name is Andrew. Better known as #coderotboga (this is self-irony, if that). I am mastering Flutter in live-code mode, already 567 broadcasts . Without cuts - "from zero to hero", starting with a Dart tutorial and up to a full-fledged "open-source" project in production. Also, I am soon finishing my own 100 hour online course - the teacher learns from his students. Thanks to intensive practice and previous rich experience with ReactJS, I have formed a set of agreements that I would like to present in order to receive feedback: "Your call is very important to us, stay on line."
Basic limitations
, , . : dartz β Haskell, kt_dart β Kotlin. Dart. β . KISS.
-. , : ndroid β MVP, ReactJS β Redux/MobX.
«». . , . , . β Β«unix-wayΒ». - , , .
, : . 1) . , : , , .. 2) ( , ). 3) lint β , pedantic. -.
--, . , , . - . , , . ( β , ). β . JavaScript, lerna Dart β melos. , β - , .
. , . VSCode, "workbench.editor.labelFormat": "short". . : todos_screen.dart β screens/todos.dart, todos_cubits.dart β cubits/todos.dart. . , , . ( ), . TodosBody .
, Β«protectedΒ», .. ()? β , . , . β . .
widgets , ( ) , : screens/todos.dart β TodosScreen, cubits/todos.dart β TodosCubit.
, . , lib:
common β ,
cubits β - BLoC
import.dart β
main.dart β
models β
repositories β ( )
screens β
widgets β
Firebase Authentication, . - -, BDD (Behavior Driven Development).
As an example, CRUD is implemented in BLoC & GraphQL. If you are in doubt about which architectural pattern to use for state management, then study the source code of the project. BLoC was introduced by Google back in 2018, but it's very difficult to do it simply. Felix Angelov could , I fell in love with cubit and learned how to cook it.
And finally, the icing on the cake - navigation without context with typed arguments:
class ZoomScreen extends StatelessWidget {
Route<T> getRoute<T>({bool isInitialRoute}) {
return buildRoute<T>(
'/zoom?unit_id=${unit.id}', //
builder: (_) => this,
fullscreenDialog: true,
isInitialRoute: isInitialRoute,
);
}
ZoomScreen(this.unit);
final UnitModel unit;
...
navigator.push<void>(ZoomScreen(unit).getRoute());
Source codes , and thanks for your attention.