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
b400534d
Unverified
Commit
b400534d
authored
Jan 25, 2021
by
Michael Goderbauer
Committed by
GitHub
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some stray nullOK mentions from docs (#74661)
parent
4ba184d4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
20 deletions
+19
-20
interface_level.dart
packages/flutter/lib/src/cupertino/interface_level.dart
+7
-5
about.dart
packages/flutter/lib/src/material/about.dart
+6
-8
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+2
-2
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+4
-4
router_test.dart
packages/flutter/test/widgets/router_test.dart
+0
-1
No files found.
packages/flutter/lib/src/cupertino/interface_level.dart
View file @
b400534d
...
...
@@ -24,12 +24,14 @@ enum CupertinoUserInterfaceLevelData {
/// the given data.
///
/// Querying the current elevation status using [CupertinoUserInterfaceLevel.of]
/// will cause your widget to rebuild automatically whenever the
[CupertinoUserInterfaceLevelData]
/// changes.
/// will cause your widget to rebuild automatically whenever the
///
[CupertinoUserInterfaceLevelData]
changes.
///
/// If no [CupertinoUserInterfaceLevel] is in scope then the [CupertinoUserInterfaceLevel.of]
/// method will throw an exception, unless the `nullOk` argument is set to true,
/// in which case it returns null.
/// If no [CupertinoUserInterfaceLevel] is in scope then the
/// [CupertinoUserInterfaceLevel.of] method will throw an exception.
/// Alternatively, [CupertinoUserInterfaceLevel.maybeOf] can be used, which
/// returns null instead of throwing if no [CupertinoUserInterfaceLevel] is in
/// scope.
///
/// See also:
///
...
...
packages/flutter/lib/src/material/about.dart
View file @
b400534d
...
...
@@ -1199,18 +1199,16 @@ class _MasterDetailFlow extends StatefulWidget {
/// ```dart
/// _MasterDetailFlow.of(context).openDetailPage(arguments);
/// ```
static
_MasterDetailFlowProxy
?
of
(
BuildContext
context
,
{
bool
nullOk
=
false
,
})
{
static
_MasterDetailFlowProxy
?
of
(
BuildContext
context
)
{
_PageOpener
?
pageOpener
=
context
.
findAncestorStateOfType
<
_MasterDetailScaffoldState
>();
pageOpener
??=
context
.
findAncestorStateOfType
<
_MasterDetailFlowState
>();
assert
(()
{
if
(
pageOpener
==
null
&&
!
nullOk
)
{
if
(
pageOpener
==
null
)
{
throw
FlutterError
(
'Master Detail operation requested with a context that does not include a Master Detail'
' Flow.
\n
The context used to open a detail page from the Master Detail Flow must be'
' that of a widget that is a descendant of a Master Detail Flow widget.'
);
'Master Detail operation requested with a context that does not include a Master Detail '
'Flow.
\n
The context used to open a detail page from the Master Detail Flow must be '
'that of a widget that is a descendant of a Master Detail Flow widget.'
);
}
return
true
;
}());
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
b400534d
...
...
@@ -2796,8 +2796,8 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
@override
void
didChangeDependencies
()
{
//
nullOk is valid here since both the Scaffold and ScaffoldMessenger are
// currently available for managing SnackBars.
//
Using maybeOf is valid here since both the Scaffold and ScaffoldMessenger
//
are
currently available for managing SnackBars.
final
ScaffoldMessengerState
?
_currentScaffoldMessenger
=
ScaffoldMessenger
.
maybeOf
(
context
);
// If our ScaffoldMessenger has changed, unregister with the old one first.
if
(
_scaffoldMessenger
!=
null
&&
...
...
packages/flutter/lib/src/widgets/media_query.dart
View file @
b400534d
...
...
@@ -31,8 +31,8 @@ enum Orientation {
/// window, use `MediaQuery.of(context).size`.
///
/// If no [MediaQuery] is in scope then the [MediaQuery.of] method will throw an
/// exception
, unless the `nullOk` argument is set to true, in which case it
///
returns null
.
/// exception
. Alternatively, [MediaQuery.maybeOf] may be used, which returns
///
null instead of throwing if no [MediaQuery] is in scope
.
///
/// ## Insets and Padding
///
...
...
@@ -629,8 +629,8 @@ class MediaQueryData {
/// user rotates their device).
///
/// If no [MediaQuery] is in scope then the [MediaQuery.of] method will throw an
/// exception
, unless the `nullOk` argument is set to true, in which case it
///
returns null
.
/// exception
. Alternatively, [MediaQuery.maybeOf] may be used, which returns
///
null instead of throwing if no [MediaQuery] is in scope
.
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=A3WrA4zAaPw}
///
...
...
packages/flutter/test/widgets/router_test.dart
View file @
b400534d
...
...
@@ -88,7 +88,6 @@ void main() {
Router
<
dynamic
>?
router
=
Router
.
maybeOf
(
textContext
);
expect
(
router
,
isNull
);
// Test when the nullOk is not specified.
bool
hasFlutterError
=
false
;
try
{
router
=
Router
.
of
(
textContext
);
...
...
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