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
4219dea6
Unverified
Commit
4219dea6
authored
Dec 24, 2020
by
Darren Austin
Committed by
GitHub
Dec 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrated some more widgets doc comments to null safety. (#72838)
parent
0b024108
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
37 deletions
+38
-37
animated_switcher.dart
packages/flutter/lib/src/widgets/animated_switcher.dart
+1
-1
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+4
-9
focus_manager.dart
packages/flutter/lib/src/widgets/focus_manager.dart
+14
-12
focus_traversal.dart
packages/flutter/lib/src/widgets/focus_traversal.dart
+16
-12
inherited_theme.dart
packages/flutter/lib/src/widgets/inherited_theme.dart
+1
-1
layout_builder.dart
packages/flutter/lib/src/widgets/layout_builder.dart
+1
-1
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+1
-1
No files found.
packages/flutter/lib/src/widgets/animated_switcher.dart
View file @
4219dea6
...
...
@@ -90,7 +90,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget? currentChild, Li
/// The type of transition can be changed from a cross-fade to a custom
/// transition by setting the [transitionBuilder].
///
/// {@tool dartpad --template=stateful_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_material}
/// This sample shows a counter that animates the scale of a text widget
/// whenever the value changes.
///
...
...
packages/flutter/lib/src/widgets/editable_text.dart
View file @
4219dea6
...
...
@@ -84,7 +84,7 @@ const int _kObscureShowLatestCharCursorTicks = 3;
///
/// Remember to [dispose] of the [TextEditingController] when it is no longer
/// needed. This will ensure we discard any resources used by the object.
/// {@tool dartpad --template=stateful_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_material}
/// This example creates a [TextField] with a [TextEditingController] whose
/// change listener forces the entered text to be lower case and keeps the
/// cursor at the end of the input.
...
...
@@ -926,18 +926,13 @@ class EditableText extends StatefulWidget {
/// and selection, one can add a listener to its [controller] with
/// [TextEditingController.addListener].
///
/// {@tool dartpad --template=stateful_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_material}
///
/// This example shows how onChanged could be used to check the TextField's
/// current value each time the user inserts or deletes a character.
///
/// ```dart
/// TextEditingController _controller;
///
/// void initState() {
/// super.initState();
/// _controller = TextEditingController();
/// }
/// final TextEditingController _controller = TextEditingController();
///
/// void dispose() {
/// _controller.dispose();
...
...
@@ -961,7 +956,7 @@ class EditableText extends StatefulWidget {
/// context: context,
/// builder: (BuildContext context) {
/// return AlertDialog(
/// title: const Text('Thats correct!'),
/// title: const Text('That
i
s correct!'),
/// content: Text ('13 is the right answer.'),
/// actions: <Widget>[
/// TextButton(
...
...
packages/flutter/lib/src/widgets/focus_manager.dart
View file @
4219dea6
...
...
@@ -303,10 +303,10 @@ enum UnfocusDisposition {
/// [DirectionalFocusTraversalPolicyMixin], but custom policies can be built
/// based upon these policies. See [FocusTraversalPolicy] for more information.
///
/// {@tool dartpad --template=stateless_widget_scaffold
_no_null_safety} This example shows how
///
a FocusNode should be managed if not using the [Focus] or [FocusScope]
///
widgets. See the [Focus] widget for a similar example using [Focus] and
/// [FocusScope] widgets.
/// {@tool dartpad --template=stateless_widget_scaffold
}
///
This example shows how a FocusNode should be managed if not using the
///
[Focus] or [FocusScope] widgets. See the [Focus] widget for a similar
///
example using [Focus] and
[FocusScope] widgets.
///
/// ```dart imports
/// import 'package:flutter/services.dart';
...
...
@@ -314,16 +314,16 @@ enum UnfocusDisposition {
///
/// ```dart preamble
/// class ColorfulButton extends StatefulWidget {
/// ColorfulButton({Key key}) : super(key: key);
/// ColorfulButton({Key
?
key}) : super(key: key);
///
/// @override
/// _ColorfulButtonState createState() => _ColorfulButtonState();
/// }
///
/// class _ColorfulButtonState extends State<ColorfulButton> {
/// FocusNode _node;
///
late
FocusNode _node;
/// bool _focused = false;
/// FocusAttachment _nodeAttachment;
///
late
FocusAttachment _nodeAttachment;
/// Color _color = Colors.white;
///
/// @override
...
...
@@ -406,7 +406,7 @@ enum UnfocusDisposition {
/// Widget build(BuildContext context) {
/// final TextTheme textTheme = Theme.of(context).textTheme;
/// return DefaultTextStyle(
/// style: textTheme.headline4,
/// style: textTheme.headline4
!
,
/// child: ColorfulButton(),
/// );
/// }
...
...
@@ -786,7 +786,7 @@ class FocusNode with DiagnosticableTreeMixin, ChangeNotifier {
/// previous node in the enclosing [FocusTraversalGroup], call [nextFocus] or
/// [previousFocus] instead of calling `unfocus`.
///
/// {@tool dartpad --template=stateful_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_material}
/// This example shows the difference between the different [UnfocusDisposition]
/// values for [unfocus].
///
...
...
@@ -835,9 +835,11 @@ class FocusNode with DiagnosticableTreeMixin, ChangeNotifier {
/// children: <Widget>[
/// Radio<UnfocusDisposition>(
/// groupValue: disposition,
/// onChanged: (UnfocusDisposition value) {
/// onChanged: (UnfocusDisposition
?
value) {
/// setState(() {
/// disposition = value;
/// if (value != null) {
/// disposition = value;
/// }
/// });
/// },
/// value: UnfocusDisposition.values[index],
...
...
@@ -850,7 +852,7 @@ class FocusNode with DiagnosticableTreeMixin, ChangeNotifier {
/// child: const Text('UNFOCUS'),
/// onPressed: () {
/// setState(() {
/// primaryFocus.unfocus(disposition: disposition);
/// primaryFocus
!
.unfocus(disposition: disposition);
/// });
/// },
/// ),
...
...
packages/flutter/lib/src/widgets/focus_traversal.dart
View file @
4219dea6
...
...
@@ -1256,14 +1256,18 @@ class _OrderedFocusInfo {
///
/// {@macro flutter.widgets.FocusOrder.comparable}
///
/// {@tool dartpad --template=stateless_widget_scaffold_center
_no_null_safety
}
/// {@tool dartpad --template=stateless_widget_scaffold_center}
/// This sample shows how to assign a traversal order to a widget. In the
/// example, the focus order goes from bottom right (the "One" button) to top
/// left (the "Six" button).
///
/// ```dart preamble
/// class DemoButton extends StatelessWidget {
/// const DemoButton({this.name, this.autofocus = false, this.order});
/// const DemoButton({
/// required this.name,
/// this.autofocus = false,
/// required this.order,
/// });
///
/// final String name;
/// final bool autofocus;
...
...
@@ -1466,7 +1470,7 @@ class FocusTraversalOrder extends InheritedWidget {
/// To prevent the members of the group from being focused, set the
/// [descendantsAreFocusable] attribute to false.
///
/// {@tool dartpad --template=stateless_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateless_widget_material}
/// This sample shows three rows of buttons, each grouped by a
/// [FocusTraversalGroup], each with different traversal order policies. Use tab
/// traversal to see the order they are traversed in. The first row follows a
...
...
@@ -1479,10 +1483,10 @@ class FocusTraversalOrder extends InheritedWidget {
/// /// the type of T.
/// class OrderedButton<T> extends StatefulWidget {
/// const OrderedButton({
/// this.name,
///
required
this.name,
/// this.canRequestFocus = true,
/// this.autofocus = false,
/// this.order,
///
required
this.order,
/// });
///
/// final String name;
...
...
@@ -1495,7 +1499,7 @@ class FocusTraversalOrder extends InheritedWidget {
/// }
///
/// class _OrderedButtonState<T> extends State<OrderedButton<T>> {
/// FocusNode focusNode;
///
late
FocusNode focusNode;
///
/// @override
/// void initState() {
...
...
@@ -1508,12 +1512,12 @@ class FocusTraversalOrder extends InheritedWidget {
///
/// @override
/// void dispose() {
/// focusNode
?
.dispose();
/// focusNode.dispose();
/// super.dispose();
/// }
///
/// @override
/// void didUpdateWidget(OrderedButton oldWidget) {
/// void didUpdateWidget(OrderedButton
<T>
oldWidget) {
/// super.didUpdateWidget(oldWidget);
/// focusNode.canRequestFocus = widget.canRequestFocus;
/// }
...
...
@@ -1533,7 +1537,7 @@ class FocusTraversalOrder extends InheritedWidget {
/// order = LexicalFocusOrder(widget.order.toString());
/// }
///
/// Color overlayColor(Set<MaterialState> states) {
/// Color
?
overlayColor(Set<MaterialState> states) {
/// if (states.contains(MaterialState.focused)) {
/// return Colors.red;
/// }
...
...
@@ -1543,7 +1547,7 @@ class FocusTraversalOrder extends InheritedWidget {
/// return null; // defer to the default overlayColor
/// }
///
/// Color foregroundColor(Set<MaterialState> states) {
/// Color
?
foregroundColor(Set<MaterialState> states) {
/// if (states.contains(MaterialState.focused) || states.contains(MaterialState.hovered)) {
/// return Colors.white;
/// }
...
...
@@ -1558,8 +1562,8 @@ class FocusTraversalOrder extends InheritedWidget {
/// focusNode: focusNode,
/// autofocus: widget.autofocus,
/// style: ButtonStyle(
/// overlayColor: MaterialStateProperty.resolveWith<Color>(overlayColor),
/// foregroundColor: MaterialStateProperty.resolveWith<Color>(foregroundColor),
/// overlayColor: MaterialStateProperty.resolveWith<Color
?
>(overlayColor),
/// foregroundColor: MaterialStateProperty.resolveWith<Color
?
>(foregroundColor),
/// ),
/// onPressed: () => _handleOnPressed(),
/// child: Text(widget.name),
...
...
packages/flutter/lib/src/widgets/inherited_theme.dart
View file @
4219dea6
...
...
@@ -17,7 +17,7 @@ import 'framework.dart';
/// like the contents of a new route or an overlay, will be able to see the
/// ancestor inherited themes of the context it was built in.
///
/// {@tool dartpad --template=freeform
_no_null_safety
}
/// {@tool dartpad --template=freeform}
/// This example demonstrates how `InheritedTheme.capture()` can be used
/// to wrap the contents of a new route with the inherited themes that
/// are present when the route was built - but are not present when route
...
...
packages/flutter/lib/src/widgets/layout_builder.dart
View file @
4219dea6
...
...
@@ -243,7 +243,7 @@ mixin RenderConstrainedLayoutBuilder<ConstraintType extends Constraints, ChildTy
/// in an [Align] widget. If the child might want to be bigger, consider
/// wrapping it in a [SingleChildScrollView] or [OverflowBox].
///
/// {@tool dartpad --template=stateless_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateless_widget_material}
///
/// This example uses a [LayoutBuilder] to build a different widget depending on the available width. Resize the
/// DartPad window to see [LayoutBuilder] in action!
...
...
packages/flutter/lib/src/widgets/media_query.dart
View file @
4219dea6
...
...
@@ -250,7 +250,7 @@ class MediaQueryData {
/// This property is currently only expected to be set to a non-default value
/// on Android starting with version Q.
///
/// {@tool dartpad --template=stateful_widget_material
_no_null_safety
}
/// {@tool dartpad --template=stateful_widget_material}
///
/// For apps that might be deployed on Android Q devices with full gesture
/// navigation enabled, use [systemGestureInsets] with [Padding]
...
...
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