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
0b024108
Unverified
Commit
0b024108
authored
Dec 24, 2020
by
Kate Lovett
Committed by
GitHub
Dec 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate more sample code to nnbd (#72829)
parent
a6117269
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
48 deletions
+35
-48
curves.dart
packages/flutter/lib/src/animation/curves.dart
+8
-12
refresh.dart
packages/flutter/lib/src/cupertino/refresh.dart
+1
-5
app.dart
packages/flutter/lib/src/widgets/app.dart
+2
-5
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+15
-18
scroll_view.dart
packages/flutter/lib/src/widgets/scroll_view.dart
+7
-5
sliver.dart
packages/flutter/lib/src/widgets/sliver.dart
+1
-2
will_pop_scope.dart
packages/flutter/lib/src/widgets/will_pop_scope.dart
+1
-1
No files found.
packages/flutter/lib/src/animation/curves.dart
View file @
0b024108
...
...
@@ -319,7 +319,7 @@ class Cubic extends Curve {
/// part of the curve, or hardly at all in another part of the curve, depending
/// on the definition of the curve.
///
/// {@tool dartpad --template=stateless_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateless_widget_material}
/// This example shows how to use a [Curve2D] to modify the position of a widget
/// so that it can follow an arbitrary path.
///
...
...
@@ -346,16 +346,12 @@ class Cubic extends Curve {
///
/// class FollowCurve2D extends StatefulWidget {
/// const FollowCurve2D({
/// Key key,
///
@
required this.path,
/// Key
?
key,
/// required this.path,
/// this.curve = Curves.easeInOut,
///
@
required this.child,
/// required this.child,
/// this.duration = const Duration(seconds: 1),
/// }) : assert(path != null),
/// assert(curve != null),
/// assert(child != null),
/// assert(duration != null),
/// super(key: key);
/// }) : super(key: key);
///
/// final Curve2D path;
/// final Curve curve;
...
...
@@ -368,9 +364,9 @@ class Cubic extends Curve {
///
/// class _FollowCurve2DState extends State<FollowCurve2D> with TickerProviderStateMixin {
/// // The animation controller for this animation.
/// AnimationController controller;
///
late
AnimationController controller;
/// // The animation that will be used to apply the widget's animation curve.
/// Animation<double> animation;
///
late
Animation<double> animation;
///
/// @override
/// void initState() {
...
...
@@ -414,7 +410,7 @@ class Cubic extends Curve {
/// child: CircleAvatar(
/// backgroundColor: Colors.yellow,
/// child: DefaultTextStyle(
/// style: Theme.of(context).textTheme.headline6,
/// style: Theme.of(context).textTheme.headline6
!
,
/// child: Text("B"), // Buzz, buzz!
/// ),
/// ),
...
...
packages/flutter/lib/src/cupertino/refresh.dart
View file @
0b024108
...
...
@@ -266,16 +266,12 @@ typedef RefreshCallback = Future<void> Function();
/// sliver such as [CupertinoSliverNavigationBar] and your main scrollable
/// content's sliver.
///
/// {@tool dartpad --template=stateful_widget_
material_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_
cupertino
}
///
/// When the user scrolls past [refreshTriggerPullDistance],
/// this sample shows the default iOS pull to refresh indicator for 1 second and
/// adds a new item to the top of the list view.
///
/// ```dart imports
/// import 'package:flutter/cupertino.dart';
/// ```
///
/// ```dart
/// List<Color> colors = [
/// CupertinoColors.systemYellow,
...
...
packages/flutter/lib/src/widgets/app.dart
View file @
0b024108
...
...
@@ -30,9 +30,6 @@ import 'widget_inspector.dart';
export
'dart:ui'
show
Locale
;
// Examples can assume:
// // @dart = 2.9
/// The signature of [WidgetsApp.localeListResolutionCallback].
///
/// A [LocaleListResolutionCallback] is responsible for computing the locale of the app's
...
...
@@ -883,7 +880,7 @@ class WidgetsApp extends StatefulWidget {
/// LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
/// },
/// color: const Color(0xFFFF0000),
/// builder: (BuildContext context, Widget child) {
/// builder: (BuildContext context, Widget
?
child) {
/// return const Placeholder();
/// },
/// );
...
...
@@ -937,7 +934,7 @@ class WidgetsApp extends StatefulWidget {
/// ),
/// },
/// color: const Color(0xFFFF0000),
/// builder: (BuildContext context, Widget child) {
/// builder: (BuildContext context, Widget
?
child) {
/// return const Placeholder();
/// },
/// );
...
...
packages/flutter/lib/src/widgets/binding.dart
View file @
0b024108
...
...
@@ -21,9 +21,6 @@ import 'widget_inspector.dart';
export
'dart:ui'
show
AppLifecycleState
,
Locale
;
// Examples can assume:
// // @dart = 2.9
/// Interface for classes that register with the Widgets layer binding.
///
/// When used as a mixin, provides no-op method implementations.
...
...
@@ -43,7 +40,7 @@ export 'dart:ui' show AppLifecycleState, Locale;
///
/// ```dart
/// class AppLifecycleReactor extends StatefulWidget {
/// const AppLifecycleReactor({ Key key }) : super(key: key);
/// const AppLifecycleReactor({ Key
?
key }) : super(key: key);
///
/// @override
/// _AppLifecycleReactorState createState() => _AppLifecycleReactorState();
...
...
@@ -53,16 +50,16 @@ export 'dart:ui' show AppLifecycleState, Locale;
/// @override
/// void initState() {
/// super.initState();
/// WidgetsBinding.instance.addObserver(this);
/// WidgetsBinding.instance
!
.addObserver(this);
/// }
///
/// @override
/// void dispose() {
/// WidgetsBinding.instance.removeObserver(this);
/// WidgetsBinding.instance
!
.removeObserver(this);
/// super.dispose();
/// }
///
/// AppLifecycleState _notification;
///
late
AppLifecycleState _notification;
///
/// @override
/// void didChangeAppLifecycleState(AppLifecycleState state) {
...
...
@@ -138,31 +135,31 @@ abstract class WidgetsBindingObserver {
///
/// ```dart
/// class MetricsReactor extends StatefulWidget {
/// const MetricsReactor({ Key key }) : super(key: key);
/// const MetricsReactor({ Key
?
key }) : super(key: key);
///
/// @override
/// _MetricsReactorState createState() => _MetricsReactorState();
/// }
///
/// class _MetricsReactorState extends State<MetricsReactor> with WidgetsBindingObserver {
/// Size _lastSize;
///
late
Size _lastSize;
///
/// @override
/// void initState() {
/// super.initState();
/// _lastSize = WidgetsBinding.instance.window.physicalSize;
/// WidgetsBinding.instance.addObserver(this);
/// _lastSize = WidgetsBinding.instance
!
.window.physicalSize;
/// WidgetsBinding.instance
!
.addObserver(this);
/// }
///
/// @override
/// void dispose() {
/// WidgetsBinding.instance.removeObserver(this);
/// WidgetsBinding.instance
!
.removeObserver(this);
/// super.dispose();
/// }
///
/// @override
/// void didChangeMetrics() {
/// setState(() { _lastSize = WidgetsBinding.instance.window.physicalSize; });
/// setState(() { _lastSize = WidgetsBinding.instance
!
.window.physicalSize; });
/// }
///
/// @override
...
...
@@ -196,7 +193,7 @@ abstract class WidgetsBindingObserver {
///
/// ```dart
/// class TextScaleFactorReactor extends StatefulWidget {
/// const TextScaleFactorReactor({ Key key }) : super(key: key);
/// const TextScaleFactorReactor({ Key
?
key }) : super(key: key);
///
/// @override
/// _TextScaleFactorReactorState createState() => _TextScaleFactorReactorState();
...
...
@@ -206,20 +203,20 @@ abstract class WidgetsBindingObserver {
/// @override
/// void initState() {
/// super.initState();
/// WidgetsBinding.instance.addObserver(this);
/// WidgetsBinding.instance
!
.addObserver(this);
/// }
///
/// @override
/// void dispose() {
/// WidgetsBinding.instance.removeObserver(this);
/// WidgetsBinding.instance
!
.removeObserver(this);
/// super.dispose();
/// }
///
/// double _lastTextScaleFactor;
///
late
double _lastTextScaleFactor;
///
/// @override
/// void didChangeTextScaleFactor() {
/// setState(() { _lastTextScaleFactor = WidgetsBinding.instance.window.textScaleFactor; });
/// setState(() { _lastTextScaleFactor = WidgetsBinding.instance
!
.window.textScaleFactor; });
/// }
///
/// @override
...
...
packages/flutter/lib/src/widgets/scroll_view.dart
View file @
0b024108
...
...
@@ -23,8 +23,7 @@ import 'sliver.dart';
import
'viewport.dart'
;
// Examples can assume:
// // @dart = 2.9
// int itemCount;
// late int itemCount;
/// A representation of how a [ScrollView] should dismiss the on-screen
/// keyboard.
...
...
@@ -468,7 +467,7 @@ abstract class ScrollView extends StatelessWidget {
/// ```
/// {@end-tool}
///
/// {@tool dartpad --template=stateful_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_material}
///
/// By default, if items are inserted at the "top" of a scrolling container like
/// [ListView] or [CustomScrollView], the top item and all of the items below it
...
...
@@ -1335,7 +1334,7 @@ class ListView extends BoxScrollView {
/// },
/// childCount: items.length,
/// findChildIndexCallback: (Key key) {
/// final ValueKey valueKey = key;
/// final ValueKey valueKey = key
as ValueKey
;
/// final String data = valueKey.value;
/// return items.indexOf(data);
/// }
...
...
@@ -1358,7 +1357,10 @@ class ListView extends BoxScrollView {
/// }
///
/// class KeepAlive extends StatefulWidget {
/// const KeepAlive({Key key, this.data}) : super(key: key);
/// const KeepAlive({
/// required Key key,
/// required this.data,
/// }) : super(key: key);
///
/// final String data;
///
...
...
packages/flutter/lib/src/widgets/sliver.dart
View file @
0b024108
...
...
@@ -17,8 +17,7 @@ export 'package:flutter/rendering.dart' show
SliverGridDelegateWithMaxCrossAxisExtent
;
// Examples can assume:
// // @dart = 2.9
// SliverGridDelegateWithMaxCrossAxisExtent _gridDelegate;
// late SliverGridDelegateWithMaxCrossAxisExtent _gridDelegate;
/// A callback which produces a semantic index given a widget and the local index.
///
...
...
packages/flutter/lib/src/widgets/will_pop_scope.dart
View file @
0b024108
...
...
@@ -29,7 +29,7 @@ import 'routes.dart';
/// ```
/// {@end-tool}
///
/// {@tool dartpad --template=stateful_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_material}
/// ```dart
/// bool shouldPop = true;
/// @override
...
...
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