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
32741c0e
Unverified
Commit
32741c0e
authored
Dec 22, 2020
by
Kate Lovett
Committed by
GitHub
Dec 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate sample code to NNBD (#72755)
parent
2b18b0d0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
40 deletions
+19
-40
colors.dart
packages/flutter/lib/src/cupertino/colors.dart
+2
-3
form_row.dart
packages/flutter/lib/src/cupertino/form_row.dart
+1
-4
segmented_control.dart
packages/flutter/lib/src/cupertino/segmented_control.dart
+1
-4
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+1
-4
gravity_simulation.dart
packages/flutter/lib/src/physics/gravity_simulation.dart
+1
-2
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+1
-2
box.dart
packages/flutter/lib/src/rendering/box.dart
+1
-4
debug_overflow_indicator.dart
...s/flutter/lib/src/rendering/debug_overflow_indicator.dart
+7
-10
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+4
-7
No files found.
packages/flutter/lib/src/cupertino/colors.dart
View file @
32741c0e
...
@@ -12,9 +12,8 @@ import 'interface_level.dart';
...
@@ -12,9 +12,8 @@ import 'interface_level.dart';
import
'theme.dart'
;
import
'theme.dart'
;
// Examples can assume:
// Examples can assume:
// // @dart = 2.9
// late Widget child;
// Widget child;
// late BuildContext context;
// BuildContext context;
/// A palette of [Color] constants that describe colors commonly used when
/// A palette of [Color] constants that describe colors commonly used when
/// matching the iOS platform aesthetics.
/// matching the iOS platform aesthetics.
...
...
packages/flutter/lib/src/cupertino/form_row.dart
View file @
32741c0e
...
@@ -8,9 +8,6 @@ import 'package:flutter/widgets.dart';
...
@@ -8,9 +8,6 @@ import 'package:flutter/widgets.dart';
import
'colors.dart'
;
import
'colors.dart'
;
import
'theme.dart'
;
import
'theme.dart'
;
// Examples can assume:
// // @dart = 2.9
// Content padding determined via SwiftUI's `Form` view in the iOS 14.2 SDK.
// Content padding determined via SwiftUI's `Form` view in the iOS 14.2 SDK.
const
EdgeInsetsGeometry
_kDefaultPadding
=
const
EdgeInsetsGeometry
_kDefaultPadding
=
EdgeInsetsDirectional
.
fromSTEB
(
20.0
,
6.0
,
6.0
,
6.0
);
EdgeInsetsDirectional
.
fromSTEB
(
20.0
,
6.0
,
6.0
,
6.0
);
...
@@ -45,7 +42,7 @@ const EdgeInsetsGeometry _kDefaultPadding =
...
@@ -45,7 +42,7 @@ const EdgeInsetsGeometry _kDefaultPadding =
///
///
/// ```dart
/// ```dart
/// class FlutterDemo extends StatefulWidget {
/// class FlutterDemo extends StatefulWidget {
/// FlutterDemo({Key key}) : super(key: key);
/// FlutterDemo({Key
?
key}) : super(key: key);
///
///
/// @override
/// @override
/// _FlutterDemoState createState() => _FlutterDemoState();
/// _FlutterDemoState createState() => _FlutterDemoState();
...
...
packages/flutter/lib/src/cupertino/segmented_control.dart
View file @
32741c0e
...
@@ -11,9 +11,6 @@ import 'package:flutter/widgets.dart';
...
@@ -11,9 +11,6 @@ import 'package:flutter/widgets.dart';
import
'theme.dart'
;
import
'theme.dart'
;
// Examples can assume:
// // @dart = 2.9
// Minimum padding from edges of the segmented control to edges of
// Minimum padding from edges of the segmented control to edges of
// encompassing widget.
// encompassing widget.
const
EdgeInsetsGeometry
_kHorizontalItemPadding
=
EdgeInsets
.
symmetric
(
horizontal:
16.0
);
const
EdgeInsetsGeometry
_kHorizontalItemPadding
=
EdgeInsets
.
symmetric
(
horizontal:
16.0
);
...
@@ -141,7 +138,7 @@ class CupertinoSegmentedControl<T extends Object> extends StatefulWidget {
...
@@ -141,7 +138,7 @@ class CupertinoSegmentedControl<T extends Object> extends StatefulWidget {
/// 1: Text('Child 2'),
/// 1: Text('Child 2'),
/// };
/// };
///
///
/// int currentValue;
///
late
int currentValue;
///
///
/// @override
/// @override
/// Widget build(BuildContext context) {
/// Widget build(BuildContext context) {
...
...
packages/flutter/lib/src/cupertino/text_field.dart
View file @
32741c0e
...
@@ -16,9 +16,6 @@ import 'theme.dart';
...
@@ -16,9 +16,6 @@ import 'theme.dart';
export
'package:flutter/services.dart'
show
TextInputType
,
TextInputAction
,
TextCapitalization
,
SmartQuotesType
,
SmartDashesType
;
export
'package:flutter/services.dart'
show
TextInputType
,
TextInputAction
,
TextCapitalization
,
SmartQuotesType
,
SmartDashesType
;
// Examples can assume:
// // @dart = 2.9
const
TextStyle
_kDefaultPlaceholderStyle
=
TextStyle
(
const
TextStyle
_kDefaultPlaceholderStyle
=
TextStyle
(
fontWeight:
FontWeight
.
w400
,
fontWeight:
FontWeight
.
w400
,
color:
CupertinoColors
.
placeholderText
,
color:
CupertinoColors
.
placeholderText
,
...
@@ -154,7 +151,7 @@ class _CupertinoTextFieldSelectionGestureDetectorBuilder extends TextSelectionGe
...
@@ -154,7 +151,7 @@ class _CupertinoTextFieldSelectionGestureDetectorBuilder extends TextSelectionGe
/// }
/// }
///
///
/// class _MyPrefilledTextState extends State<MyPrefilledText> {
/// class _MyPrefilledTextState extends State<MyPrefilledText> {
/// TextEditingController _textController;
///
late
TextEditingController _textController;
///
///
/// @override
/// @override
/// void initState() {
/// void initState() {
...
...
packages/flutter/lib/src/physics/gravity_simulation.dart
View file @
32741c0e
...
@@ -5,8 +5,7 @@
...
@@ -5,8 +5,7 @@
import
'simulation.dart'
;
import
'simulation.dart'
;
// Examples can assume:
// Examples can assume:
// // @dart = 2.9
// late AnimationController _controller;
// AnimationController _controller;
/// A simulation that applies a constant accelerating force.
/// A simulation that applies a constant accelerating force.
///
///
...
...
packages/flutter/lib/src/rendering/binding.dart
View file @
32741c0e
...
@@ -20,7 +20,6 @@ import 'view.dart';
...
@@ -20,7 +20,6 @@ import 'view.dart';
export
'package:flutter/gestures.dart'
show
HitTestResult
;
export
'package:flutter/gestures.dart'
show
HitTestResult
;
// Examples can assume:
// Examples can assume:
// // @dart = 2.9
// dynamic context;
// dynamic context;
/// The glue between the render tree and the Flutter engine.
/// The glue between the render tree and the Flutter engine.
...
@@ -221,7 +220,7 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
...
@@ -221,7 +220,7 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
/// Querying [PlatformDispatcher.platformBrightness].
/// Querying [PlatformDispatcher.platformBrightness].
///
///
/// ```dart
/// ```dart
/// final Brightness brightness = WidgetsBinding.instance.platformDispatcher.platformBrightness;
/// final Brightness brightness = WidgetsBinding.instance
!
.platformDispatcher.platformBrightness;
/// ```
/// ```
/// {@end-tool}
/// {@end-tool}
///
///
...
...
packages/flutter/lib/src/rendering/box.dart
View file @
32741c0e
...
@@ -13,9 +13,6 @@ import 'package:vector_math/vector_math_64.dart';
...
@@ -13,9 +13,6 @@ import 'package:vector_math/vector_math_64.dart';
import
'debug.dart'
;
import
'debug.dart'
;
import
'object.dart'
;
import
'object.dart'
;
// Examples can assume:
// // @dart = 2.9
// This class should only be used in debug builds.
// This class should only be used in debug builds.
class
_DebugSize
extends
Size
{
class
_DebugSize
extends
Size
{
_DebugSize
(
Size
source
,
this
.
_owner
,
this
.
_canBeUsedByParent
)
:
super
.
copy
(
source
);
_DebugSize
(
Size
source
,
this
.
_owner
,
this
.
_canBeUsedByParent
)
:
super
.
copy
(
source
);
...
@@ -718,7 +715,7 @@ class BoxHitTestResult extends HitTestResult {
...
@@ -718,7 +715,7 @@ class BoxHitTestResult extends HitTestResult {
/// }
/// }
///
///
/// @override
/// @override
/// bool hitTestChildren(BoxHitTestResult result, { Offset position }) {
/// bool hitTestChildren(BoxHitTestResult result, {
required
Offset position }) {
/// return result.addWithPaintTransform(
/// return result.addWithPaintTransform(
/// transform: _effectiveTransform,
/// transform: _effectiveTransform,
/// position: position,
/// position: position,
...
...
packages/flutter/lib/src/rendering/debug_overflow_indicator.dart
View file @
32741c0e
...
@@ -11,9 +11,6 @@ import 'package:flutter/foundation.dart';
...
@@ -11,9 +11,6 @@ import 'package:flutter/foundation.dart';
import
'object.dart'
;
import
'object.dart'
;
import
'stack.dart'
;
import
'stack.dart'
;
// Examples can assume:
// // @dart = 2.9
// Describes which side the region data overflows on.
// Describes which side the region data overflows on.
enum
_OverflowSide
{
enum
_OverflowSide
{
left
,
left
,
...
@@ -57,20 +54,20 @@ class _OverflowRegionData {
...
@@ -57,20 +54,20 @@ class _OverflowRegionData {
/// ```dart
/// ```dart
/// class MyRenderObject extends RenderAligningShiftedBox with DebugOverflowIndicatorMixin {
/// class MyRenderObject extends RenderAligningShiftedBox with DebugOverflowIndicatorMixin {
/// MyRenderObject({
/// MyRenderObject({
/// AlignmentGeometry alignment,
/// AlignmentGeometry alignment
= Alignment.center
,
/// TextDirection textDirection,
/// TextDirection
?
textDirection,
/// RenderBox child,
/// RenderBox
?
child,
/// }) : super.mixin(alignment, textDirection, child);
/// }) : super.mixin(alignment, textDirection, child);
///
///
/// Rect _containerRect;
///
late
Rect _containerRect;
/// Rect _childRect;
///
late
Rect _childRect;
///
///
/// @override
/// @override
/// void performLayout() {
/// void performLayout() {
/// // ...
/// // ...
/// final BoxParentData childParentData = child
.p
arentData;
/// final BoxParentData childParentData = child
!.parentData! as BoxP
arentData;
/// _containerRect = Offset.zero & size;
/// _containerRect = Offset.zero & size;
/// _childRect = childParentData.offset & child.size;
/// _childRect = childParentData.offset & child
!
.size;
/// }
/// }
///
///
/// @override
/// @override
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
32741c0e
...
@@ -28,9 +28,6 @@ export 'package:flutter/gestures.dart' show
...
@@ -28,9 +28,6 @@ export 'package:flutter/gestures.dart' show
PointerUpEvent
,
PointerUpEvent
,
PointerCancelEvent
;
PointerCancelEvent
;
// Examples can assume:
// // @dart = 2.9
/// A base class for render boxes that resemble their children.
/// A base class for render boxes that resemble their children.
///
///
/// A proxy box has a single child and simply mimics all the properties of that
/// A proxy box has a single child and simply mimics all the properties of that
...
@@ -3053,7 +3050,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
...
@@ -3053,7 +3050,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
///
///
/// ```dart
/// ```dart
/// class PngHome extends StatefulWidget {
/// class PngHome extends StatefulWidget {
/// PngHome({Key key}) : super(key: key);
/// PngHome({Key
?
key}) : super(key: key);
///
///
/// @override
/// @override
/// _PngHomeState createState() => _PngHomeState();
/// _PngHomeState createState() => _PngHomeState();
...
@@ -3063,10 +3060,10 @@ class RenderRepaintBoundary extends RenderProxyBox {
...
@@ -3063,10 +3060,10 @@ class RenderRepaintBoundary extends RenderProxyBox {
/// GlobalKey globalKey = GlobalKey();
/// GlobalKey globalKey = GlobalKey();
///
///
/// Future<void> _capturePng() async {
/// Future<void> _capturePng() async {
/// RenderRepaintBoundary boundary = globalKey.currentContext
.findRenderObject()
;
/// RenderRepaintBoundary boundary = globalKey.currentContext
!.findRenderObject()! as RenderRepaintBoundary
;
/// ui.Image image = await boundary.toImage();
/// ui.Image image = await boundary.toImage();
/// ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
/// ByteData
?
byteData = await image.toByteData(format: ui.ImageByteFormat.png);
/// Uint8List pngBytes = byteData.buffer.asUint8List();
/// Uint8List pngBytes = byteData
!
.buffer.asUint8List();
/// print(pngBytes);
/// print(pngBytes);
/// }
/// }
///
///
...
...
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