Vorkytaka / mini_tools

0 stars 0 forks source link

Architecture for the tools #56

Closed Vorkytaka closed 1 month ago

Vorkytaka commented 1 month ago

Need to think about architecture of the app. The problem is that currently we handle state management with just StatefulWidget, and for some cases it's fine, but for some it's not.

Need something really easy to use, serializable, flutterable and (maybe) with separation of sync and async logic.

Vorkytaka commented 1 month ago

What about just to use ValueNotifier as state holder, add some manager around it and provider to handle inherited widgets easily?

Vorkytaka commented 1 month ago

For now we take simple Cubit and Bloc, should make something like optional blocCreator with Tool. Tool will create global Bloc if creator is providen.

Vorkytaka commented 1 month ago

For the future: it will be interesting to try make Tool to handle build of each part of the scaffold. Like, make

abstract interface class Tool {
  // ...
  Widget buildMainContent(BuildContext context, ScrollController controller);
  Widget buildLeftPane(BuildContext context, ScrollController controller);
  //  etc.
  // ...
}

The problem is we lost control over UI and parts of the screen, but we make some standarts.