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
a665dd1c
Unverified
Commit
a665dd1c
authored
4 years ago
by
Michael Goderbauer
Committed by
GitHub
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate more doc samples (#72392)
parent
0dc80621
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
54 deletions
+40
-54
container.dart
packages/flutter/lib/src/widgets/container.dart
+3
-4
fade_in_image.dart
packages/flutter/lib/src/widgets/fade_in_image.dart
+1
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+23
-26
page_view.dart
packages/flutter/lib/src/widgets/page_view.dart
+4
-13
scroll_physics.dart
packages/flutter/lib/src/widgets/scroll_physics.dart
+6
-3
value_listenable_builder.dart
...ges/flutter/lib/src/widgets/value_listenable_builder.dart
+3
-6
No files found.
packages/flutter/lib/src/widgets/container.dart
View file @
a665dd1c
...
...
@@ -11,8 +11,7 @@ import 'framework.dart';
import
'image.dart'
;
// Examples can assume:
// // @dart = 2.9
// BuildContext context;
// late BuildContext context;
/// A widget that paints a [Decoration] either before or after its child paints.
///
...
...
@@ -219,7 +218,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// ```dart
/// Container(
/// constraints: BoxConstraints.expand(
/// height: Theme.of(context).textTheme.headline4
.fontSize
* 1.1 + 200.0,
/// height: Theme.of(context).textTheme.headline4
!.fontSize!
* 1.1 + 200.0,
/// ),
/// padding: const EdgeInsets.all(8.0),
/// color: Colors.blue[600],
...
...
@@ -227,7 +226,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// child: Text('Hello World',
/// style: Theme.of(context)
/// .textTheme
/// .headline4
/// .headline4
!
/// .copyWith(color: Colors.white)),
/// transform: Matrix4.rotationZ(0.1),
/// )
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/fade_in_image.dart
View file @
a665dd1c
...
...
@@ -14,8 +14,7 @@ import 'implicit_animations.dart';
import
'transitions.dart'
;
// Examples can assume:
// // @dart = 2.9
// Uint8List bytes;
// late Uint8List bytes;
/// An image that shows a [placeholder] image while the target [image] is
/// loading, then fades in the new image when it loads.
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/framework.dart
View file @
a665dd1c
...
...
@@ -30,12 +30,11 @@ export 'package:flutter/foundation.dart' show Key, LocalKey, ValueKey;
export
'package:flutter/rendering.dart'
show
RenderObject
,
RenderBox
,
debugDumpRenderTree
,
debugDumpLayerTree
;
// Examples can assume:
// // @dart = 2.9
// BuildContext context;
// late BuildContext context;
// void setState(VoidCallback fn) { }
// abstract class RenderFrogJar extends RenderObject { }
// abstract class FrogJar extends RenderObjectWidget { }
// abstract class FrogJarParentData extends ParentData { Size size; }
// abstract class FrogJarParentData extends ParentData {
late
Size size; }
// KEYS
...
...
@@ -624,7 +623,7 @@ abstract class Widget extends DiagnosticableTree {
///
/// ```dart
/// class GreenFrog extends StatelessWidget {
/// const GreenFrog({ Key key }) : super(key: key);
/// const GreenFrog({ Key
?
key }) : super(key: key);
///
/// @override
/// Widget build(BuildContext context) {
...
...
@@ -642,13 +641,13 @@ abstract class Widget extends DiagnosticableTree {
/// ```dart
/// class Frog extends StatelessWidget {
/// const Frog({
/// Key key,
/// Key
?
key,
/// this.color = const Color(0xFF2DBD3A),
/// this.child,
/// }) : super(key: key);
///
/// final Color color;
/// final Widget child;
/// final Widget
?
child;
///
/// @override
/// Widget build(BuildContext context) {
...
...
@@ -841,7 +840,7 @@ abstract class StatelessWidget extends Widget {
///
/// ```dart
/// class YellowBird extends StatefulWidget {
/// const YellowBird({ Key key }) : super(key: key);
/// const YellowBird({ Key
?
key }) : super(key: key);
///
/// @override
/// _YellowBirdState createState() => _YellowBirdState();
...
...
@@ -864,13 +863,13 @@ abstract class StatelessWidget extends Widget {
/// ```dart
/// class Bird extends StatefulWidget {
/// const Bird({
/// Key key,
/// Key
?
key,
/// this.color = const Color(0xFFFFE306),
/// this.child,
/// }) : super(key: key);
///
/// final Color color;
/// final Widget child;
/// final Widget
?
child;
///
/// _BirdState createState() => _BirdState();
/// }
...
...
@@ -1531,21 +1530,19 @@ abstract class ProxyWidget extends Widget {
/// ```dart
/// class FrogSize extends ParentDataWidget<FrogJarParentData> {
/// FrogSize({
/// Key key,
/// @required this.size,
/// @required Widget child,
/// }) : assert(child != null),
/// assert(size != null),
/// super(key: key, child: child);
/// Key? key,
/// required this.size,
/// required Widget child,
/// }) : super(key: key, child: child);
///
/// final Size size;
///
/// @override
/// void applyParentData(RenderObject renderObject) {
/// final FrogJarParentData parentData = renderObject.parentData;
/// final FrogJarParentData parentData = renderObject.parentData
! as FrogJarParentData
;
/// if (parentData.size != size) {
/// parentData.size = size;
/// final RenderFrogJar targetParent = renderObject.parent;
/// final RenderFrogJar targetParent = renderObject.parent
! as RenderFrogJar
;
/// targetParent.markNeedsLayout();
/// }
/// }
...
...
@@ -1684,17 +1681,17 @@ abstract class ParentDataWidget<T extends ParentData> extends ProxyWidget {
/// ```dart
/// class FrogColor extends InheritedWidget {
/// const FrogColor({
/// Key key,
/// @required this.color,
/// @required Widget child,
/// }) : assert(color != null),
/// assert(child != null),
/// super(key: key, child: child);
/// Key? key,
/// required this.color,
/// required Widget child,
/// }) : super(key: key, child: child);
///
/// final Color color;
///
/// static FrogColor of(BuildContext context) {
/// return context.dependOnInheritedWidgetOfExactType<FrogColor>();
/// final FrogColor? result = context.dependOnInheritedWidgetOfExactType<FrogColor>();
/// assert(result != null, 'No FrogColor found in context');
/// return result!;
/// }
///
/// @override
...
...
@@ -2420,7 +2417,7 @@ abstract class BuildContext {
/// {@tool snippet}
///
/// ```dart
/// ScrollableState scrollable = context.findAncestorStateOfType<ScrollableState>();
/// ScrollableState
?
scrollable = context.findAncestorStateOfType<ScrollableState>();
/// ```
/// {@end-tool}
T
?
findAncestorStateOfType
<
T
extends
State
>();
...
...
@@ -4436,7 +4433,7 @@ typedef ErrorWidgetBuilder = Widget Function(FlutterErrorDetails details);
///
/// It is possible to override this widget.
///
/// {@tool sample --template=freeform
_no_null_safety
}
/// {@tool sample --template=freeform}
/// ```dart
/// import 'package:flutter/material.dart';
///
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/page_view.dart
View file @
a665dd1c
...
...
@@ -27,9 +27,6 @@ import 'sliver.dart';
import
'sliver_fill.dart'
;
import
'viewport.dart'
;
// Examples can assume:
// // @dart = 2.9
/// A controller for [PageView].
///
/// A page controller lets you manipulate which page is visible in a [PageView].
...
...
@@ -49,19 +46,13 @@ import 'viewport.dart';
///
/// ```dart
/// class MyPageView extends StatefulWidget {
/// MyPageView({Key key}) : super(key: key);
/// MyPageView({Key
?
key}) : super(key: key);
///
/// _MyPageViewState createState() => _MyPageViewState();
/// }
///
/// class _MyPageViewState extends State<MyPageView> {
/// PageController _pageController;
///
/// @override
/// void initState() {
/// super.initState();
/// _pageController = PageController();
/// }
/// PageController _pageController = PageController();
///
/// @override
/// void dispose() {
...
...
@@ -725,7 +716,7 @@ class PageView extends StatefulWidget {
/// },
/// childCount: items.length,
/// findChildIndexCallback: (Key key) {
/// final ValueKey
valueKey = key
;
/// final ValueKey
<String> valueKey = key as ValueKey<String>
;
/// final String data = valueKey.value;
/// return items.indexOf(data);
/// }
...
...
@@ -748,7 +739,7 @@ class PageView extends StatefulWidget {
/// }
///
/// class KeepAlive extends StatefulWidget {
/// const KeepAlive({Key
key,
this.data}) : super(key: key);
/// const KeepAlive({Key
? key, required
this.data}) : super(key: key);
///
/// final String data;
///
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/scroll_physics.dart
View file @
a665dd1c
...
...
@@ -17,12 +17,15 @@ import 'scroll_simulation.dart';
export
'package:flutter/physics.dart'
show
Simulation
,
ScrollSpringSimulation
,
Tolerance
;
// Examples can assume:
// // @dart = 2.9
// class FooScrollPhysics extends ScrollPhysics {
// const FooScrollPhysics({ ScrollPhysics parent }): super(parent: parent);
// const FooScrollPhysics({ ScrollPhysics? parent }): super(parent: parent);
// @override
// FooScrollPhysics applyTo(ScrollPhysics? ancestor) {
// return FooScrollPhysics(parent: buildParent(ancestor));
// }
// }
// class BarScrollPhysics extends ScrollPhysics {
// const BarScrollPhysics({ ScrollPhysics parent }): super(parent: parent);
// const BarScrollPhysics({ ScrollPhysics
?
parent }): super(parent: parent);
// }
/// Determines the physics of a [Scrollable] widget.
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/value_listenable_builder.dart
View file @
a665dd1c
...
...
@@ -6,9 +6,6 @@ import 'package:flutter/foundation.dart';
import
'framework.dart'
;
// Examples can assume:
// // @dart = 2.9
/// Builds a [Widget] when given a concrete value of a [ValueListenable<T>].
///
/// If the `child` parameter provided to the [ValueListenableBuilder] is not
...
...
@@ -50,7 +47,7 @@ typedef ValueWidgetBuilder<T> = Widget Function(BuildContext context, T value, W
///
/// ```dart
/// class MyHomePage extends StatefulWidget {
/// MyHomePage({Key
key,
this.title}) : super(key: key);
/// MyHomePage({Key
? key, required
this.title}) : super(key: key);
/// final String title;
///
/// @override
...
...
@@ -72,14 +69,14 @@ typedef ValueWidgetBuilder<T> = Widget Function(BuildContext context, T value, W
/// children: <Widget>[
/// Text('You have pushed the button this many times:'),
/// ValueListenableBuilder(
/// builder: (BuildContext context, int value, Widget child) {
/// builder: (BuildContext context, int value, Widget
?
child) {
/// // This builder will only get called when the _counter
/// // is updated.
/// return Row(
/// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
/// children: <Widget>[
/// Text('$value'),
/// child,
/// child
!
,
/// ],
/// );
/// },
...
...
This diff is collapsed.
Click to expand it.
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