Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
b3bb5cd6
Unverified
Commit
b3bb5cd6
authored
Apr 10, 2019
by
Shi-Hao Hong
Committed by
GitHub
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix StatefulWidget and StatelessWidget Sample Documentation (#30814)
parent
eb30745f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+15
-14
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
b3bb5cd6
...
...
@@ -490,7 +490,10 @@ abstract class Widget extends DiagnosticableTree {
///
/// {@tool sample}
///
/// The following is a skeleton of a stateless widget subclass called `GreenFrog`:
/// The following is a skeleton of a stateless widget subclass called `GreenFrog`.
///
/// Normally, widgets have more constructor arguments, each of which corresponds
/// to a `final` property.
///
/// ```dart
/// class GreenFrog extends StatelessWidget {
...
...
@@ -503,22 +506,21 @@ abstract class Widget extends DiagnosticableTree {
/// }
/// ```
/// {@end-tool}
///
/// {@tool sample}
///
/// Normally widgets have more constructor arguments, each of which corresponds
/// to a `final` property. The next example shows the more generic widget `Frog`
/// which can be given a color and a child:
/// This next example shows the more generic widget `Frog` which can be given
/// a color and a child:
///
/// ```dart
/// class Frog extends StatelessWidget {
/// const Frog({
/// Key key,
/// this.color
:
const Color(0xFF2DBD3A),
/// this.color
=
const Color(0xFF2DBD3A),
/// this.child,
/// }) : super(key: key);
///
/// final Color color;
///
/// final Widget child;
///
/// @override
...
...
@@ -702,7 +704,11 @@ abstract class StatelessWidget extends Widget {
///
/// {@tool sample}
///
/// The following is a skeleton of a stateful widget subclass called `YellowBird`:
/// This is a skeleton of a stateful widget subclass called `YellowBird`.
///
/// In this example. the [State] has no actual state. State is normally
/// represented as private member fields. Also, normally widgets have more
/// constructor arguments, each of which corresponds to a `final` property.
///
/// ```dart
/// class YellowBird extends StatefulWidget {
...
...
@@ -722,11 +728,7 @@ abstract class StatelessWidget extends Widget {
/// {@end-tool}
/// {@tool sample}
///
/// In this example. the [State] has no actual state. State is normally
/// represented as private member fields. Also, normally widgets have more
/// constructor arguments, each of which corresponds to a `final` property.
///
/// The next example shows the more generic widget `Bird` which can be given a
/// This example shows the more generic widget `Bird` which can be given a
/// color and a child, and which has some internal state with a method that
/// can be called to mutate it:
///
...
...
@@ -734,12 +736,11 @@ abstract class StatelessWidget extends Widget {
/// class Bird extends StatefulWidget {
/// const Bird({
/// Key key,
/// this.color
:
const Color(0xFFFFE306),
/// this.color
=
const Color(0xFFFFE306),
/// this.child,
/// }) : super(key: key);
///
/// final Color color;
///
/// final Widget child;
///
/// _BirdState createState() => _BirdState();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment