mwwm 0.0.3 copy "mwwm: ^0.0.3" to clipboard
mwwm: ^0.0.3 copied to clipboard

discontinued
outdated

Reflection of widget in a single entity

MWWM #

Software architectural pattern for Flutter apps.

Description #

MWWM is based on principles of Clean Architecture and is a variation of MVVM.

It consists of three parts: Widget, WidgetModel and Model.

Widget — a representation layer that contains only UI related code.

WidgetModel - handles and accumulates all data needed for Widget: objects of the domain layer, scroll position, text fields values, animation state, etc. WidgetModel uses Model for interaction with various data sources.

Model - a link between WidgetModel and "the external world": data sources, services or other abstraction layers. It allows to develop both separately and have a possibility to modify one layer with no need for changing the other. Model is represented by two components: Change (a signal to model which means what we want to achieve) and Performer (that knows how to achieve it).

Why? #

This architecture completely separates design and logic. Adds the ability to work on independent layers by different developers. Adds autonomy to work, like HTML and CSS.

How to use #

  1. Create widget which extends CoreMwwmWidget
class CounterScreen extends CoreMwwmWidget {
  CounterScreen()
      : super(
            //...
          ),
          widgetStateBuilder: //... ,
        );
}
  1. Create State for this widget which extends WidgetState
class _CounterScreenState extends WidgetState<CounterWidgetModel> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: //... ,
    );
  }
}
  1. Define widgetStateBuilder for your widget in super.
super(
          // ...
          widgetStateBuilder: () => _CounterScreenState(),
        );
  1. Create WidgetModel by extending WidgetModel class and provide here ErrorHandler and Model
45
likes
0
pub points
49%
popularity

Publisher

verified publishersurf.ru

Reflection of widget in a single entity

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on mwwm