Flutter

All widgets in Flutter. The concept of widgets in Flutter is broader. They can represent not only UI elements, but also functional components such as: GestureDetector widget for gesture detection, Theme for APP Theme data delivery, etc. In the following sections, we may use concepts like “controls” and “components” when describing UI elements. Remember that they are widgets, just different terms.

1 Classification of Flutter components

A Flutter can be classified by state, but also by functional responsibilities and properties. In our case, they can be classified by functional responsibilities and properties. The components include: basic component layout component container component Functional component Scrollable component Decoration component

2 Basic class components

As mentioned above, the basic components include text components, button components, image components, selection components, input fields, forms, progress bars, and so on. This will be explained in detail in the following chapters. These are the most basic widgets, and most miscellaneous widgets contain these components, so you must learn them.

3 Use of basic components

Flutter provides a rich and powerful library of basic components. On top of this library, Flutter provides a Material style (the default Android visual style) and a Cupertino style (the iOS visual style). To use the base component library, you need to import:

import 'package:flutter/widgets.dart';
Copy the code

After that, you can use and edit the underlying components.

  • Material components

The Material application starts with the MaterialApp component, which creates the necessary components at the root of the application, such as the Theme component, which is used to configure the Theme of the application. Using the Material component, you need to introduce:

 import 'package:flutter/material.dart';
Copy the code
  • Cupertino components

Cupertino style components are provided primarily for IOS adaptation. Use also requires introduction

 import 'package:flutter/cupertino.dart';
Copy the code

Note: Since Material and Cupertino are both based on the base component library, there is no need to introduce flutter/widgets.dart if we have one of them in our application because they are already introduced internally.