Functionalities

Understanding reusable component for Flutter

logo

Pratik Chothani | Engineering

August 26, 2022
image
Author
logo

Pratik Chothani | Engineering

{
August 26, 2022
}

Duplicating so many widgets just for a little change can lead to poor code maintainability and readability. What could be the best possible way to get rid of these things? Reusable components or Widgets!!! It is always a good practice to identify and create reusable components to maintain consistency throughout the app.

And, DhiWise has simplified the process even further by automatically identifying and generating code for Reusable components.

DhiWise identifies reusable components like Button, EditText, DropDown, and so on. Along with that, it identifies all possible design styles for each reusable component, and the code for each is generated once and reused throughout the app.

The Clean Architecture is the most powerful solutions for building clean apps that multiple teams can work on, independent data layers, scalable for adding/removing features, testable, independent frameworks/tools, and can be easily maintained at any time.

Standard & Structure of generated code

Dhiwise generated source code with most popular Clean Architecture as it’s easier to use and widely accepted. For any project to be successful and easy to work on, it’s always required that you follow industry standards and best practices suggested by industry experts who have been there long before some of us even started working on it.With that said, Let’s see how DhiWise follow coding standards to generate code for you.

There are certain parameters that we follow which is Naming standards, Modular Code, Comment written where required and etc.

The most integral part of any system is its folder structure and how you organise your files and play with it. Because after all, who doesn’t love the organised cupboards right?Well, when you think about it, It makes sense as everyone has different perception and their own way to look at their codes and structures. Since you can’t force anyone to follow any particular folder structure, it’s always good to come up with your own best version of it.Please check below, How we organise our files.

Image

Reusable Components

We want developers to work as less as possible on repetitive tasks and hence this being one of them, we identify 41 types of components from basic to highly advanced.

DhiWise offers you reusability out of the box by identifying custom & reusable components. Yeah, by that we mean, Design System of your application. We identify common components that’s getting repeated on most of the page and convert those components into Design System components with already defined prop-types in components. Learn more

Image

Preview of Reusable Components

Every reusable component's preview and design styles are available in the components tab in the Smart Editor. Additionally, we can change the design settings, and each screen of the app that uses these reusable components will seamlessly reflect all the changes.

Image