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
5a21e2d8
Unverified
Commit
5a21e2d8
authored
Mar 23, 2021
by
Jenn Magder
Committed by
GitHub
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make version and time in flutter_tool null safe (#78836)
parent
0bde67e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
time.dart
packages/flutter_tools/lib/src/base/time.dart
+0
-2
version.dart
packages/flutter_tools/lib/src/base/version.dart
+6
-8
No files found.
packages/flutter_tools/lib/src/base/time.dart
View file @
5a21e2d8
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
/// A class for making time based operations testable.
class
SystemClock
{
/// A const constructor to allow subclasses to be const.
...
...
packages/flutter_tools/lib/src/base/version.dart
View file @
5a21e2d8
...
...
@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'package:meta/meta.dart'
;
@immutable
class
Version
implements
Comparable
<
Version
>
{
/// Creates a new [Version] object.
factory
Version
(
int
major
,
int
minor
,
int
patch
,
{
String
text
})
{
factory
Version
(
int
?
major
,
int
?
minor
,
int
?
patch
,
{
String
?
text
})
{
if
(
text
==
null
)
{
text
=
major
==
null
?
'0'
:
'
$major
'
;
if
(
minor
!=
null
)
{
...
...
@@ -36,8 +34,8 @@ class Version implements Comparable<Version> {
}
/// Creates a new [Version] by parsing [text].
factory
Version
.
parse
(
String
text
)
{
final
Match
match
=
versionPattern
.
firstMatch
(
text
??
''
);
static
Version
?
parse
(
String
?
text
)
{
final
Match
?
match
=
versionPattern
.
firstMatch
(
text
??
''
);
if
(
match
==
null
)
{
return
null
;
}
...
...
@@ -46,7 +44,7 @@ class Version implements Comparable<Version> {
final
int
major
=
int
.
parse
(
match
[
1
]
??
'0'
);
final
int
minor
=
int
.
parse
(
match
[
3
]
??
'0'
);
final
int
patch
=
int
.
parse
(
match
[
5
]
??
'0'
);
return
Version
.
_
(
major
,
minor
,
patch
,
text
);
return
Version
.
_
(
major
,
minor
,
patch
,
text
??
''
);
}
on
FormatException
{
return
null
;
}
...
...
@@ -55,8 +53,8 @@ class Version implements Comparable<Version> {
/// Returns the primary version out of a list of candidates.
///
/// This is the highest-numbered stable version.
static
Version
primary
(
List
<
Version
>
versions
)
{
Version
primary
;
static
Version
?
primary
(
List
<
Version
>
versions
)
{
Version
?
primary
;
for
(
final
Version
version
in
versions
)
{
if
(
primary
==
null
||
(
version
>
primary
))
{
primary
=
version
;
...
...
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