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
ce31d4ff
Unverified
Commit
ce31d4ff
authored
Mar 24, 2021
by
Jenn Magder
Committed by
GitHub
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate android_console to null safety (#78923)
parent
7148cc61
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
49 deletions
+35
-49
android_console.dart
packages/flutter_tools/lib/src/android/android_console.dart
+8
-9
project_migrator.dart
packages/flutter_tools/lib/src/base/project_migrator.dart
+0
-2
utils.dart
packages/flutter_tools/lib/src/base/utils.dart
+0
-1
iproxy.dart
packages/flutter_tools/lib/src/ios/iproxy.dart
+6
-9
plist_parser.dart
packages/flutter_tools/lib/src/ios/plist_parser.dart
+5
-8
io.dart
packages/flutter_tools/test/src/io.dart
+16
-18
test_wrapper.dart
packages/flutter_tools/test/src/test_wrapper.dart
+0
-2
No files found.
packages/flutter_tools/lib/src/android/android_console.dart
View file @
ce31d4ff
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:async/async.dart'
;
import
'package:async/async.dart'
;
import
'../base/io.dart'
;
import
'../base/io.dart'
;
import
'../convert.dart'
;
import
'../convert.dart'
;
...
@@ -28,20 +27,20 @@ typedef AndroidConsoleSocketFactory = Future<Socket> Function(String host, int p
...
@@ -28,20 +27,20 @@ typedef AndroidConsoleSocketFactory = Future<Socket> Function(String host, int p
class
AndroidConsole
{
class
AndroidConsole
{
AndroidConsole
(
this
.
_socket
);
AndroidConsole
(
this
.
_socket
);
Socket
_socket
;
Socket
?
_socket
;
StreamQueue
<
String
>
_queue
;
StreamQueue
<
String
>
?
_queue
;
Future
<
void
>
connect
()
async
{
Future
<
void
>
connect
()
async
{
assert
(
_socket
!=
null
);
assert
(
_socket
!=
null
);
assert
(
_queue
==
null
);
assert
(
_queue
==
null
);
_queue
=
StreamQueue
<
String
>(
_socket
.
asyncMap
(
ascii
.
decode
));
_queue
=
StreamQueue
<
String
>(
_socket
!
.
asyncMap
(
ascii
.
decode
));
// Discard any initial connection text.
// Discard any initial connection text.
await
_readResponse
();
await
_readResponse
();
}
}
Future
<
String
>
getAvdName
()
async
{
Future
<
String
?
>
getAvdName
()
async
{
if
(
_queue
==
null
)
{
if
(
_queue
==
null
)
{
return
null
;
return
null
;
}
}
...
@@ -55,17 +54,17 @@ class AndroidConsole {
...
@@ -55,17 +54,17 @@ class AndroidConsole {
_queue
=
null
;
_queue
=
null
;
}
}
Future
<
String
>
_readResponse
()
async
{
Future
<
String
?
>
_readResponse
()
async
{
if
(
_queue
==
null
)
{
if
(
_queue
==
null
)
{
return
null
;
return
null
;
}
}
final
StringBuffer
output
=
StringBuffer
();
final
StringBuffer
output
=
StringBuffer
();
while
(
true
)
{
while
(
true
)
{
if
(!
await
_queue
.
hasNext
)
{
if
(!
await
_queue
!
.
hasNext
)
{
destroy
();
destroy
();
return
null
;
return
null
;
}
}
final
String
text
=
await
_queue
.
next
;
final
String
text
=
await
_queue
!
.
next
;
final
String
trimmedText
=
text
.
trim
();
final
String
trimmedText
=
text
.
trim
();
if
(
trimmedText
==
'OK'
)
{
if
(
trimmedText
==
'OK'
)
{
break
;
break
;
...
...
packages/flutter_tools/lib/src/base/project_migrator.dart
View file @
ce31d4ff
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
import
'file_system.dart'
;
import
'file_system.dart'
;
...
...
packages/flutter_tools/lib/src/base/utils.dart
View file @
ce31d4ff
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:async'
;
import
'dart:math'
as
math
;
import
'dart:math'
as
math
;
...
...
packages/flutter_tools/lib/src/ios/iproxy.dart
View file @
ce31d4ff
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:meta/meta.dart'
;
import
'package:process/process.dart'
;
import
'package:process/process.dart'
;
import
'../base/io.dart'
;
import
'../base/io.dart'
;
...
@@ -16,10 +13,10 @@ import '../base/process.dart';
...
@@ -16,10 +13,10 @@ import '../base/process.dart';
/// See https://github.com/libimobiledevice/libusbmuxd.
/// See https://github.com/libimobiledevice/libusbmuxd.
class
IProxy
{
class
IProxy
{
IProxy
({
IProxy
({
@
required
String
iproxyPath
,
required
String
iproxyPath
,
@
required
Logger
logger
,
required
Logger
logger
,
@
required
ProcessManager
processManager
,
required
ProcessManager
processManager
,
@
required
MapEntry
<
String
,
String
>
dyLdLibEntry
,
required
MapEntry
<
String
,
String
>
dyLdLibEntry
,
})
:
_dyLdLibEntry
=
dyLdLibEntry
,
})
:
_dyLdLibEntry
=
dyLdLibEntry
,
_processUtils
=
ProcessUtils
(
processManager:
processManager
,
logger:
logger
),
_processUtils
=
ProcessUtils
(
processManager:
processManager
,
logger:
logger
),
_iproxyPath
=
iproxyPath
;
_iproxyPath
=
iproxyPath
;
...
@@ -29,8 +26,8 @@ class IProxy {
...
@@ -29,8 +26,8 @@ class IProxy {
/// This specifies the path to iproxy as 'iproxy` and the dyLdLibEntry as
/// This specifies the path to iproxy as 'iproxy` and the dyLdLibEntry as
/// 'DYLD_LIBRARY_PATH: /path/to/libs'.
/// 'DYLD_LIBRARY_PATH: /path/to/libs'.
factory
IProxy
.
test
({
factory
IProxy
.
test
({
@
required
Logger
logger
,
required
Logger
logger
,
@
required
ProcessManager
processManager
,
required
ProcessManager
processManager
,
})
{
})
{
return
IProxy
(
return
IProxy
(
iproxyPath:
'iproxy'
,
iproxyPath:
'iproxy'
,
...
...
packages/flutter_tools/lib/src/ios/plist_parser.dart
View file @
ce31d4ff
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:meta/meta.dart'
;
import
'package:process/process.dart'
;
import
'package:process/process.dart'
;
import
'../base/file_system.dart'
;
import
'../base/file_system.dart'
;
...
@@ -16,9 +13,9 @@ import '../convert.dart';
...
@@ -16,9 +13,9 @@ import '../convert.dart';
class
PlistParser
{
class
PlistParser
{
PlistParser
({
PlistParser
({
@
required
FileSystem
fileSystem
,
required
FileSystem
fileSystem
,
@
required
Logger
logger
,
required
Logger
logger
,
@
required
ProcessManager
processManager
,
required
ProcessManager
processManager
,
})
:
_fileSystem
=
fileSystem
,
})
:
_fileSystem
=
fileSystem
,
_logger
=
logger
,
_logger
=
logger
,
_processUtils
=
ProcessUtils
(
logger:
logger
,
processManager:
processManager
);
_processUtils
=
ProcessUtils
(
logger:
logger
,
processManager:
processManager
);
...
@@ -58,7 +55,7 @@ class PlistParser {
...
@@ -58,7 +55,7 @@ class PlistParser {
args
,
args
,
throwOnError:
true
,
throwOnError:
true
,
).
stdout
.
trim
();
).
stdout
.
trim
();
return
castStringKeyedMap
(
json
.
decode
(
jsonContent
));
return
castStringKeyedMap
(
json
.
decode
(
jsonContent
))
??
const
<
String
,
dynamic
>{}
;
}
on
ProcessException
catch
(
error
)
{
}
on
ProcessException
catch
(
error
)
{
_logger
.
printTrace
(
'
$error
'
);
_logger
.
printTrace
(
'
$error
'
);
return
const
<
String
,
dynamic
>{};
return
const
<
String
,
dynamic
>{};
...
@@ -74,7 +71,7 @@ class PlistParser {
...
@@ -74,7 +71,7 @@ class PlistParser {
/// If [key] is not found in the property list, this will return null.
/// If [key] is not found in the property list, this will return null.
///
///
/// The [plistFilePath] and [key] arguments must not be null.
/// The [plistFilePath] and [key] arguments must not be null.
String
getValueFromFile
(
String
plistFilePath
,
String
key
)
{
String
?
getValueFromFile
(
String
plistFilePath
,
String
key
)
{
assert
(
key
!=
null
);
assert
(
key
!=
null
);
final
Map
<
String
,
dynamic
>
parsed
=
parseFile
(
plistFilePath
);
final
Map
<
String
,
dynamic
>
parsed
=
parseFile
(
plistFilePath
);
return
parsed
[
key
]
as
String
;
return
parsed
[
key
]
as
String
;
...
...
packages/flutter_tools/test/src/io.dart
View file @
ce31d4ff
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:io'
as
io
show
IOOverrides
,
Directory
,
File
,
Link
;
import
'dart:io'
as
io
show
IOOverrides
,
Directory
,
File
,
Link
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
...
@@ -19,17 +17,17 @@ import 'package:flutter_tools/src/base/file_system.dart';
...
@@ -19,17 +17,17 @@ import 'package:flutter_tools/src/base/file_system.dart';
/// The only safe delegate types are those that do not call out to `dart:io`,
/// The only safe delegate types are those that do not call out to `dart:io`,
/// like the [MemoryFileSystem].
/// like the [MemoryFileSystem].
class
FlutterIOOverrides
extends
io
.
IOOverrides
{
class
FlutterIOOverrides
extends
io
.
IOOverrides
{
FlutterIOOverrides
({
FileSystem
fileSystem
})
FlutterIOOverrides
({
FileSystem
?
fileSystem
})
:
_fileSystemDelegate
=
fileSystem
;
:
_fileSystemDelegate
=
fileSystem
;
final
FileSystem
_fileSystemDelegate
;
final
FileSystem
?
_fileSystemDelegate
;
@override
@override
io
.
Directory
createDirectory
(
String
path
)
{
io
.
Directory
createDirectory
(
String
path
)
{
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
createDirectory
(
path
);
return
super
.
createDirectory
(
path
);
}
}
return
_fileSystemDelegate
.
directory
(
path
);
return
_fileSystemDelegate
!
.
directory
(
path
);
}
}
@override
@override
...
@@ -37,7 +35,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -37,7 +35,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
createFile
(
path
);
return
super
.
createFile
(
path
);
}
}
return
_fileSystemDelegate
.
file
(
path
);
return
_fileSystemDelegate
!
.
file
(
path
);
}
}
@override
@override
...
@@ -45,7 +43,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -45,7 +43,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
createLink
(
path
);
return
super
.
createLink
(
path
);
}
}
return
_fileSystemDelegate
.
link
(
path
);
return
_fileSystemDelegate
!
.
link
(
path
);
}
}
@override
@override
...
@@ -53,7 +51,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -53,7 +51,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
fsWatch
(
path
,
events
,
recursive
);
return
super
.
fsWatch
(
path
,
events
,
recursive
);
}
}
return
_fileSystemDelegate
.
file
(
path
).
watch
(
events:
events
,
recursive:
recursive
);
return
_fileSystemDelegate
!
.
file
(
path
).
watch
(
events:
events
,
recursive:
recursive
);
}
}
@override
@override
...
@@ -61,7 +59,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -61,7 +59,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
fsWatchIsSupported
();
return
super
.
fsWatchIsSupported
();
}
}
return
_fileSystemDelegate
.
isWatchSupported
;
return
_fileSystemDelegate
!
.
isWatchSupported
;
}
}
@override
@override
...
@@ -69,7 +67,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -69,7 +67,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
fseGetType
(
path
,
followLinks
);
return
super
.
fseGetType
(
path
,
followLinks
);
}
}
return
_fileSystemDelegate
.
type
(
path
,
followLinks:
followLinks
??
true
);
return
_fileSystemDelegate
!.
type
(
path
,
followLinks:
followLinks
);
}
}
@override
@override
...
@@ -77,7 +75,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -77,7 +75,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
fseGetTypeSync
(
path
,
followLinks
);
return
super
.
fseGetTypeSync
(
path
,
followLinks
);
}
}
return
_fileSystemDelegate
.
typeSync
(
path
,
followLinks:
followLinks
??
true
);
return
_fileSystemDelegate
!.
typeSync
(
path
,
followLinks:
followLinks
);
}
}
@override
@override
...
@@ -85,7 +83,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -85,7 +83,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
fseIdentical
(
path1
,
path2
);
return
super
.
fseIdentical
(
path1
,
path2
);
}
}
return
_fileSystemDelegate
.
identical
(
path1
,
path2
);
return
_fileSystemDelegate
!
.
identical
(
path1
,
path2
);
}
}
@override
@override
...
@@ -93,7 +91,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -93,7 +91,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
fseIdenticalSync
(
path1
,
path2
);
return
super
.
fseIdenticalSync
(
path1
,
path2
);
}
}
return
_fileSystemDelegate
.
identicalSync
(
path1
,
path2
);
return
_fileSystemDelegate
!
.
identicalSync
(
path1
,
path2
);
}
}
@override
@override
...
@@ -101,7 +99,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -101,7 +99,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
getCurrentDirectory
();
return
super
.
getCurrentDirectory
();
}
}
return
_fileSystemDelegate
.
currentDirectory
;
return
_fileSystemDelegate
!
.
currentDirectory
;
}
}
@override
@override
...
@@ -109,7 +107,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -109,7 +107,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
getSystemTempDirectory
();
return
super
.
getSystemTempDirectory
();
}
}
return
_fileSystemDelegate
.
systemTempDirectory
;
return
_fileSystemDelegate
!
.
systemTempDirectory
;
}
}
@override
@override
...
@@ -117,7 +115,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -117,7 +115,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
setCurrentDirectory
(
path
);
return
super
.
setCurrentDirectory
(
path
);
}
}
_fileSystemDelegate
.
currentDirectory
=
path
;
_fileSystemDelegate
!
.
currentDirectory
=
path
;
}
}
@override
@override
...
@@ -125,7 +123,7 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -125,7 +123,7 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
stat
(
path
);
return
super
.
stat
(
path
);
}
}
return
_fileSystemDelegate
.
stat
(
path
);
return
_fileSystemDelegate
!
.
stat
(
path
);
}
}
@override
@override
...
@@ -133,6 +131,6 @@ class FlutterIOOverrides extends io.IOOverrides {
...
@@ -133,6 +131,6 @@ class FlutterIOOverrides extends io.IOOverrides {
if
(
_fileSystemDelegate
==
null
)
{
if
(
_fileSystemDelegate
==
null
)
{
return
super
.
statSync
(
path
);
return
super
.
statSync
(
path
);
}
}
return
_fileSystemDelegate
.
statSync
(
path
);
return
_fileSystemDelegate
!
.
statSync
(
path
);
}
}
}
}
packages/flutter_tools/test/src/test_wrapper.dart
View file @
ce31d4ff
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:test/test.dart'
hide
isInstanceOf
;
import
'package:test/test.dart'
hide
isInstanceOf
;
export
'package:test/test.dart'
hide
isInstanceOf
;
export
'package:test/test.dart'
hide
isInstanceOf
;
...
...
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