How to document Flutter widgets and screens classes in my app? - flutter

I don't know what is the common way and best practices used in documenting UI widgets and components in a Flutter app, I could find a good resource on how to document dart code in general here
And how you can describe a function behavior or a model attribute.
But what is the best way to add comments for UI Classes, Screens, Refactored Widgets, etc..
so that it can be helpful and describes the widget or the screen contents?

The whole flutter project is open source. You could always check how the flutter team documents its widgets.
For example, here is the source of the Container widget:
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/container.dart
Personally, I would only document widgets which I publish as part of a library. But tastes are different :D

Related

What is the best way to build a page template in flutter

Is there any kind of template builder for flutter (e.g. similar to jinja) or what is the best way to build a page template inside the app?
Traditional template mechanisms provide a way to separate the static content (text, graphics etc) from the dynamic data at design time. At run time you provide the dynamic data and it is rendered in the template.
Flutter has no such concept - the whole display is rendered by widget code. But you can think of widget code as templates that render the run time data.

How To: Add flutter screen from one flutter app to another?

I See this:
Add different routes/screens to Flutter app
but not the same thing.
So. I have several Flutter "TEMPLATE" apps, not real code, just the views not hooked up to the backend.
I am using Flutter Template A as the base with its screens.
Now I want to grab some Screens from Flutter Template B and Add/Import them into Flutter Template A
Again, I want to grab some Screens from Flutter Template C and Add/Import them into Flutter Template A
I am new to Flutter - but have over 35 development experiences in a broad range of languages.
Which files needed to move "A Screen" over and add to the router?
If anyone has done this, please help.
It needs what it needs. There are view, model, and controller classes, perhaps all in one file, or spread out across multiple directories. So many ways of doing it that your question is unanswerable without looking at the code. If you got these "templates" from a vendor, hopefully the vendor documented some of that.

Flutter looking for date picker

I am too new in flutter I need to know is there any widget or package for date picker something like this?
I am looking for something similar to this I try to find in flutter builtin packages but not able to find similar
Flutter is UI oriented, however, the specific widget you have posted does not come built-in, in-fact most widgets come in a skeleton form, and design is left to you, therefore, your imagination is the only limit to UI designs.
Despite this, the ever-growing flutter community has developed multiple packages for all sorts of widget designs. You may find a package close to what you have shown, here.

How to visualize rendered widget in test? Flutter

I am writing some widget tests and very often I get overflow errors. I would love to be able to visualize the widgets pumped in a test to help me in debugging. Something similar to setting headless to false in web testing frameworks. Is this possible?
Use Flutter Layout Explorer ,
The Flutter Layout Explorer helps you to better understand Flutter
layouts. Currently, the Layout Explorer only supports exploration of
flex layouts, but it may be extended to other types of layouts in the
future.
You also have an option to use Codepens. It is great for visualizing ,sharing your UI design, you can also embed pens on your site/blog

Elements vs Components in Flutter

Our team is planning on rewriting a mid sized app that was mostly in React. We are drawing a new architecture in Flutter. In this effort we are discussing proper terminology and how to classify different objects. In React, there is a meaningful difference between Elements and Components.
In the official Flutter documentation both words Elements and Components, are used for what -implicitly- seems to be different things https://flutter.dev/docs/development/ui/widgets/material
"Material Components widgets"
"Expansion panels contain creation flows and allow lightweight editing of an element"
What are the difference between those two? In particular are controllers, elements, states, images considered as components?
I think "components" is vocabulary for Material Design. Components are design concepts. https://material.io/components/
"Widgets" are classes in Flutter.
Flutter widgets are often implementations of Material Design components.
Continuing from comment. Break your folder structure like
|--ui
|--login
|--home
|-- ......
|--modal
|--rest
|--routes
|--helpers
etc as per your convenience. Also make custom widgets which are to be used everywhere combining other simpler widgets and can put in helper folder.
Also look at other opensource flutter projects. You will get a better idea how everyone else are grouping things.