Various doc fixes (#35548)
This commit is contained in:
committed by
GitHub
parent
559c9982dd
commit
4e973adc79
@@ -68,33 +68,35 @@ follows:
|
||||
|
||||
- [`stateful_widget`](stateful_widget.tmpl) :
|
||||
The default code block will be placed as the body of the `State` object of a
|
||||
StatefulWidget subclass. Because the default code block is placed as the body
|
||||
of a stateful widget, you will need to implement the `build()` function, and any
|
||||
`StatefulWidget` subclass. Because the default code block is placed as the body
|
||||
of a stateful widget, you will need to implement the `build()` method, and any
|
||||
state variables. It also has a `preamble` in addition to the default code
|
||||
block, which will be placed at the top level of the Dart file, so bare
|
||||
function calls are not allowed in the preamble. It also has an `imports`
|
||||
method calls are not allowed in the preamble. The default code block is
|
||||
placed as the body of a stateful widget, so you will need to implement the
|
||||
`build()` method, and any state variables. It also has an `imports`
|
||||
section to import additional packages. Please only import things that are part
|
||||
of flutter or part of default dependencies for a `flutter create` project.
|
||||
It creates a WidgetsApp around the child stateful widget.
|
||||
It creates a `WidgetsApp` around the child stateful widget.
|
||||
|
||||
- [`stateless_widget`](stateless_widget.tmpl) :
|
||||
Identical to the `stateful_widget` template, except that the default code
|
||||
block is inserted as the `build` function in a
|
||||
StatelessWidget. There is no need to include the @override before the build
|
||||
function (the template adds this for you).
|
||||
- [`stateless_widget`](stateless_widget.tmpl) : Identical to the
|
||||
`stateful_widget` template, except that the default code block is
|
||||
inserted as a method (which should be the `build` method) in a
|
||||
`StatelessWidget`. The `@override` before the build method is added by
|
||||
the template, so must be omitted from the sample code.
|
||||
|
||||
- [`stateful_widget_material`](stateful_widget_material.tmpl) : Similar to
|
||||
`stateful_widget`, except that it imports the material library, and uses
|
||||
a MaterialApp instead of WidgetsApp.
|
||||
a `MaterialApp` instead of `WidgetsApp`.
|
||||
|
||||
- [`stateless_widget_material`](stateless_widget_material.tmpl) : Similar to
|
||||
`stateless_widget`, except that it imports the material library, and uses
|
||||
a MaterialApp instead of WidgetsApp.
|
||||
a `MaterialApp` instead of `WidgetsApp`.
|
||||
|
||||
- [`stateful_widget_scaffold`](stateful_widget_scaffold.tmpl) : Similar to
|
||||
`stateful_widget_material`, except that it wraps the stateful widget with a
|
||||
Scaffold.
|
||||
`Scaffold`.
|
||||
|
||||
- [`stateless_widget_scaffold`](stateless_widget_scaffold.tmpl) : Similar to
|
||||
`stateless_widget_material`, except that it wraps the stateless widget with a
|
||||
Scaffold.
|
||||
`Scaffold`.
|
||||
|
||||
Reference in New Issue
Block a user