2024年4月28日发(作者:)

flutter常见页面写法

## Usage of Common Page Styles in Flutter.

1. State Management:

`StatefulWidget`: For widgets whose state can change

over time and that require rebuilding the widget when the

state changes.

`setState()`: Method to update the widget's state,

which triggers a rebuild.

`Bloc` and `Redux`: External state management libraries

that provide a more structured approach to managing complex

state.

2. Page Routing:

`Navigator`: Used to manage the stack of pages in your

app.

`push()` and `pop()`: Methods to add and remove pages

from the stack.

`MaterialPageRoute` and `CupertinoPageRoute`: Default

page routes that handle transitions.

3. Layouts:

`Row` and `Column`: Widgets that align widgets

horizontally or vertically.

`Stack` and `Positioned`: Widgets that allow you to

position widgets on top of each other.

`Flex` and `Expanded`: Widgets that control the

resizing and spacing of child widgets.

4. Widget Stylization:

`Container`: Widget that can be styled with properties

such as color, padding, and margin.