50
An abstraction for handling layout is provided by the rendering layer. We can create a tree of
renderable items with this layer. These objects can be dynamically changed, and the tree will update its
layout to reflect the modifications. The widgets layer is an abstraction of composition. There is a class in
the widgets layer for each render object in the rendering layer. Additionally, we can define reusable class
combinations in the widgets layer. The reactive programming model is introduced at this tier to make the
app responsive. The color box, hue slider, and radio buttons are just a few of the places where the state
can be altered. Changes must appear everywhere else when the user interacts with the UI. Even worse, if
caution is not used, a little modification to one area of the user interface may affect other seemingly
unrelated sections of code. Flutter and other reactive frameworks handle this problem differently by
explicitly isolating the user interface from its underlying state. You only need to build a user interface
(UI) description with React-style APIs, and the framework will use it to generate and/or update the user
interface as needed.
Flutter widgets are modeled after immutable classes that resemble React components. the construction
of an object tree. These widgets are used to manage an independent tree of objects for compositing as
well as an independent tree of objects for layout. Flutter's primary function is to rapidly cycle through
updated tree sections, demote entries to lower-level objects, and propagate tree change. The number of
design concepts is kept to a minimum while still preserving a wide vocabulary. For instance, Flutter uses
the same fundamental idea (a Widget) in the widgets layer to represent drawing to the screen, layout
(positioning and scaling), user interaction, state management, theming, animations, and navigation. The
concepts of Animations and Tweens occupy the majority of the design space in the animation layer.
Layout, painting, hit testing, and accessibility are all described at the rendering layer using render objects.
There are a large number of widgets, render objects, animation and tween types, and each of these
circumstances leads to a large vocabulary for the proper terminology.
To maximize the number of options, the class hierarchy is purposefully short and broad, focusing on
small, assemblable widgets that each do one thing exceptionally well. Even fundamental features like
padding and alignment are implemented as independent components rather than being incorporated into
the core since core features are abstract. (This contrasts with more conventional APIs, which incorporate
elements like padding into the fundamental structure of each layout component.) To center a widget, for
instance, you would wrap it in a Center widget rather than changing a notional Align attribute. Padding,
alignment, rows, columns, and grids are all covered by widgets. These layout widgets lack a unique visual
representation. Instead, their main function is to regulate a certain feature of the layout of another widget.
Utility widgets in Flutter also benefit from this compositional strategy.
For instance, the often-used widget Container is composed of various widgets that are in charge of the
layout, painting, positioning, and scaling. Reading the source code of Container reveals that it is
composed of the DecoratedBox MaterialBox, Rows, Columns, Padding, Align, Sateful and Stateless
widgets. Being able to study any widget's source code irrespective of the position of the widget in the
tree, is one of Flutter's distinguishing features. One can simply compose it to achieve a unique effect
rather than the usual subclassing of the Container. Integrate existing widgets in fresh ways, or just make a
new widget by drawing ideas from MaterialContainer.
4. Implementation
Using the system design described above we have made an app using the flutter platform that
integrates all the components that we have discussed so far. We have created this app keeping the
convenience and ease of use of the user in our mind. We have developed the application as follows: