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
d40cc5af
Unverified
Commit
d40cc5af
authored
Apr 13, 2021
by
Jenn Magder
Committed by
GitHub
Apr 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate flutter_tool plugins.dart to null safety (#80304)
parent
474db18a
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1029 additions
and
1017 deletions
+1029
-1017
build_ios_framework.dart
...s/flutter_tools/lib/src/commands/build_ios_framework.dart
+1
-1
packages.dart
packages/flutter_tools/lib/src/commands/packages.dart
+1
-0
flutter_plugins.dart
packages/flutter_tools/lib/src/flutter_plugins.dart
+981
-0
resident_web_runner.dart
...s/flutter_tools/lib/src/isolated/resident_web_runner.dart
+1
-0
build_linux.dart
packages/flutter_tools/lib/src/linux/build_linux.dart
+1
-1
cocoapod_utils.dart
packages/flutter_tools/lib/src/macos/cocoapod_utils.dart
+1
-1
platform_plugins.dart
packages/flutter_tools/lib/src/platform_plugins.dart
+6
-6
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+13
-985
project.dart
packages/flutter_tools/lib/src/project.dart
+1
-1
compile.dart
packages/flutter_tools/lib/src/web/compile.dart
+1
-0
build_windows.dart
packages/flutter_tools/lib/src/windows/build_windows.dart
+1
-1
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+1
-1
plugin_parsing_test.dart
...flutter_tools/test/general.shard/plugin_parsing_test.dart
+18
-20
plugins_test.dart
packages/flutter_tools/test/general.shard/plugins_test.dart
+1
-0
plugins_test.dart
...lutter_tools/test/general.shard/windows/plugins_test.dart
+1
-0
No files found.
packages/flutter_tools/lib/src/commands/build_ios_framework.dart
View file @
d40cc5af
...
...
@@ -19,9 +19,9 @@ import '../build_system/targets/common.dart';
import
'../build_system/targets/icon_tree_shaker.dart'
;
import
'../build_system/targets/ios.dart'
;
import
'../cache.dart'
;
import
'../flutter_plugins.dart'
;
import
'../globals.dart'
as
globals
;
import
'../macos/cocoapod_utils.dart'
;
import
'../plugins.dart'
;
import
'../project.dart'
;
import
'../runner/flutter_command.dart'
show
DevelopmentArtifact
,
FlutterCommandResult
;
import
'../version.dart'
;
...
...
packages/flutter_tools/lib/src/commands/packages.dart
View file @
d40cc5af
...
...
@@ -13,6 +13,7 @@ import '../build_system/build_system.dart';
import
'../cache.dart'
;
import
'../dart/generate_synthetic_packages.dart'
;
import
'../dart/pub.dart'
;
import
'../flutter_plugins.dart'
;
import
'../globals.dart'
as
globals
;
import
'../plugins.dart'
;
import
'../project.dart'
;
...
...
packages/flutter_tools/lib/src/flutter_plugins.dart
0 → 100644
View file @
d40cc5af
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/isolated/resident_web_runner.dart
View file @
d40cc5af
...
...
@@ -30,6 +30,7 @@ import '../dart/language_version.dart';
import
'../devfs.dart'
;
import
'../device.dart'
;
import
'../features.dart'
;
import
'../flutter_plugins.dart'
;
import
'../platform_plugins.dart'
;
import
'../plugins.dart'
;
import
'../project.dart'
;
...
...
packages/flutter_tools/lib/src/linux/build_linux.dart
View file @
d40cc5af
...
...
@@ -15,9 +15,9 @@ import '../build_info.dart';
import
'../cache.dart'
;
import
'../cmake.dart'
;
import
'../convert.dart'
;
import
'../flutter_plugins.dart'
;
import
'../globals.dart'
as
globals
;
import
'../migrations/cmake_custom_command_migration.dart'
;
import
'../plugins.dart'
;
import
'../project.dart'
;
// Matches the following error and warning patterns:
...
...
packages/flutter_tools/lib/src/macos/cocoapod_utils.dart
View file @
d40cc5af
...
...
@@ -7,8 +7,8 @@
import
'../base/fingerprint.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
import
'../flutter_plugins.dart'
;
import
'../globals.dart'
as
globals
;
import
'../plugins.dart'
;
import
'../project.dart'
;
/// For a given build, determines whether dependencies have changed since the
...
...
packages/flutter_tools/lib/src/platform_plugins.dart
View file @
d40cc5af
...
...
@@ -209,14 +209,14 @@ class MacOSPlugin extends PluginPlatform implements NativeOrDartPlugin {
factory
MacOSPlugin
.
fromYaml
(
String
name
,
YamlMap
yaml
)
{
assert
(
validate
(
yaml
));
// Treat 'none' as not present. See https://github.com/flutter/flutter/issues/57497.
String
?
pluginClass
=
yaml
[
kPluginClass
]
as
String
;
String
?
pluginClass
=
yaml
[
kPluginClass
]
as
String
?
;
if
(
pluginClass
==
'none'
)
{
pluginClass
=
null
;
}
return
MacOSPlugin
(
name:
name
,
pluginClass:
pluginClass
,
dartPluginClass:
yaml
[
kDartPluginClass
]
as
String
,
dartPluginClass:
yaml
[
kDartPluginClass
]
as
String
?
,
);
}
...
...
@@ -260,14 +260,14 @@ class WindowsPlugin extends PluginPlatform implements NativeOrDartPlugin{
factory
WindowsPlugin
.
fromYaml
(
String
name
,
YamlMap
yaml
)
{
assert
(
validate
(
yaml
));
// Treat 'none' as not present. See https://github.com/flutter/flutter/issues/57497.
String
?
pluginClass
=
yaml
[
kPluginClass
]
as
String
;
String
?
pluginClass
=
yaml
[
kPluginClass
]
as
String
?
;
if
(
pluginClass
==
'none'
)
{
pluginClass
=
null
;
}
return
WindowsPlugin
(
name:
name
,
pluginClass:
pluginClass
,
dartPluginClass:
yaml
[
kDartPluginClass
]
as
String
,
dartPluginClass:
yaml
[
kDartPluginClass
]
as
String
?
,
);
}
...
...
@@ -312,14 +312,14 @@ class LinuxPlugin extends PluginPlatform implements NativeOrDartPlugin {
factory
LinuxPlugin
.
fromYaml
(
String
name
,
YamlMap
yaml
)
{
assert
(
validate
(
yaml
));
// Treat 'none' as not present. See https://github.com/flutter/flutter/issues/57497.
String
?
pluginClass
=
yaml
[
kPluginClass
]
as
String
;
String
?
pluginClass
=
yaml
[
kPluginClass
]
as
String
?
;
if
(
pluginClass
==
'none'
)
{
pluginClass
=
null
;
}
return
LinuxPlugin
(
name:
name
,
pluginClass:
pluginClass
,
dartPluginClass:
yaml
[
kDartPluginClass
]
as
String
,
dartPluginClass:
yaml
[
kDartPluginClass
]
as
String
?
,
);
}
...
...
packages/flutter_tools/lib/src/plugins.dart
View file @
d40cc5af
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/project.dart
View file @
d40cc5af
...
...
@@ -18,12 +18,12 @@ import 'build_info.dart';
import
'bundle.dart'
as
bundle
;
import
'features.dart'
;
import
'flutter_manifest.dart'
;
import
'flutter_plugins.dart'
;
import
'globals.dart'
as
globals
;
import
'ios/plist_parser.dart'
;
import
'ios/xcodeproj.dart'
as
xcode
;
import
'ios/xcodeproj.dart'
;
import
'platform_plugins.dart'
;
import
'plugins.dart'
;
import
'template.dart'
;
class
FlutterProjectFactory
{
...
...
packages/flutter_tools/lib/src/web/compile.dart
View file @
d40cc5af
...
...
@@ -14,6 +14,7 @@ import '../build_system/targets/common.dart';
import
'../build_system/targets/icon_tree_shaker.dart'
;
import
'../build_system/targets/web.dart'
;
import
'../cache.dart'
;
import
'../flutter_plugins.dart'
;
import
'../globals.dart'
as
globals
;
import
'../platform_plugins.dart'
;
import
'../plugins.dart'
;
...
...
packages/flutter_tools/lib/src/windows/build_windows.dart
View file @
d40cc5af
...
...
@@ -15,9 +15,9 @@ import '../build_info.dart';
import
'../cache.dart'
;
import
'../cmake.dart'
;
import
'../convert.dart'
;
import
'../flutter_plugins.dart'
;
import
'../globals.dart'
as
globals
;
import
'../migrations/cmake_custom_command_migration.dart'
;
import
'../plugins.dart'
;
import
'../project.dart'
;
import
'visual_studio.dart'
;
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
d40cc5af
...
...
@@ -11,9 +11,9 @@ import 'package:flutter_tools/src/base/logger.dart';
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/flutter_plugins.dart'
;
import
'package:flutter_tools/src/ios/xcodeproj.dart'
;
import
'package:flutter_tools/src/macos/cocoapods.dart'
;
import
'package:flutter_tools/src/plugins.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
import
'package:test/fake.dart'
;
...
...
packages/flutter_tools/test/general.shard/plugin_parsing_test.dart
View file @
d40cc5af
...
...
@@ -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
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/platform_plugins.dart'
;
...
...
@@ -31,8 +29,8 @@ void main() {
fileSystem:
fileSystem
,
);
final
AndroidPlugin
androidPlugin
=
plugin
.
platforms
[
AndroidPlugin
.
kConfigKey
]
as
AndroidPlugin
;
final
IOSPlugin
iosPlugin
=
plugin
.
platforms
[
IOSPlugin
.
kConfigKey
]
as
IOSPlugin
;
final
AndroidPlugin
androidPlugin
=
plugin
.
platforms
[
AndroidPlugin
.
kConfigKey
]
!
as
AndroidPlugin
;
final
IOSPlugin
iosPlugin
=
plugin
.
platforms
[
IOSPlugin
.
kConfigKey
]
!
as
IOSPlugin
;
final
String
androidPluginClass
=
androidPlugin
.
pluginClass
;
final
String
iosPluginClass
=
iosPlugin
.
pluginClass
;
...
...
@@ -69,12 +67,12 @@ void main() {
fileSystem:
fileSystem
,
);
final
AndroidPlugin
androidPlugin
=
plugin
.
platforms
[
AndroidPlugin
.
kConfigKey
]
as
AndroidPlugin
;
final
IOSPlugin
iosPlugin
=
plugin
.
platforms
[
IOSPlugin
.
kConfigKey
]
as
IOSPlugin
;
final
LinuxPlugin
linuxPlugin
=
plugin
.
platforms
[
LinuxPlugin
.
kConfigKey
]
as
LinuxPlugin
;
final
MacOSPlugin
macOSPlugin
=
plugin
.
platforms
[
MacOSPlugin
.
kConfigKey
]
as
MacOSPlugin
;
final
WebPlugin
webPlugin
=
plugin
.
platforms
[
WebPlugin
.
kConfigKey
]
as
WebPlugin
;
final
WindowsPlugin
windowsPlugin
=
plugin
.
platforms
[
WindowsPlugin
.
kConfigKey
]
as
WindowsPlugin
;
final
AndroidPlugin
androidPlugin
=
plugin
.
platforms
[
AndroidPlugin
.
kConfigKey
]
!
as
AndroidPlugin
;
final
IOSPlugin
iosPlugin
=
plugin
.
platforms
[
IOSPlugin
.
kConfigKey
]
!
as
IOSPlugin
;
final
LinuxPlugin
linuxPlugin
=
plugin
.
platforms
[
LinuxPlugin
.
kConfigKey
]
!
as
LinuxPlugin
;
final
MacOSPlugin
macOSPlugin
=
plugin
.
platforms
[
MacOSPlugin
.
kConfigKey
]
!
as
MacOSPlugin
;
final
WebPlugin
webPlugin
=
plugin
.
platforms
[
WebPlugin
.
kConfigKey
]
!
as
WebPlugin
;
final
WindowsPlugin
windowsPlugin
=
plugin
.
platforms
[
WindowsPlugin
.
kConfigKey
]
!
as
WindowsPlugin
;
final
String
androidPluginClass
=
androidPlugin
.
pluginClass
;
final
String
iosPluginClass
=
iosPlugin
.
pluginClass
;
...
...
@@ -118,12 +116,12 @@ void main() {
fileSystem:
fileSystem
,
);
final
AndroidPlugin
androidPlugin
=
plugin
.
platforms
[
AndroidPlugin
.
kConfigKey
]
as
AndroidPlugin
;
final
IOSPlugin
iosPlugin
=
plugin
.
platforms
[
IOSPlugin
.
kConfigKey
]
as
IOSPlugin
;
final
LinuxPlugin
linuxPlugin
=
plugin
.
platforms
[
LinuxPlugin
.
kConfigKey
]
as
LinuxPlugin
;
final
MacOSPlugin
macOSPlugin
=
plugin
.
platforms
[
MacOSPlugin
.
kConfigKey
]
as
MacOSPlugin
;
final
WebPlugin
webPlugin
=
plugin
.
platforms
[
WebPlugin
.
kConfigKey
]
as
WebPlugin
;
final
WindowsPlugin
windowsPlugin
=
plugin
.
platforms
[
WindowsPlugin
.
kConfigKey
]
as
WindowsPlugin
;
final
AndroidPlugin
androidPlugin
=
plugin
.
platforms
[
AndroidPlugin
.
kConfigKey
]
!
as
AndroidPlugin
;
final
IOSPlugin
iosPlugin
=
plugin
.
platforms
[
IOSPlugin
.
kConfigKey
]
!
as
IOSPlugin
;
final
LinuxPlugin
linuxPlugin
=
plugin
.
platforms
[
LinuxPlugin
.
kConfigKey
]
!
as
LinuxPlugin
;
final
MacOSPlugin
macOSPlugin
=
plugin
.
platforms
[
MacOSPlugin
.
kConfigKey
]
!
as
MacOSPlugin
;
final
WebPlugin
webPlugin
=
plugin
.
platforms
[
WebPlugin
.
kConfigKey
]
!
as
WebPlugin
;
final
WindowsPlugin
windowsPlugin
=
plugin
.
platforms
[
WindowsPlugin
.
kConfigKey
]
!
as
WindowsPlugin
;
final
String
androidPluginClass
=
androidPlugin
.
pluginClass
;
final
String
iosPluginClass
=
iosPlugin
.
pluginClass
;
...
...
@@ -159,9 +157,9 @@ void main() {
fileSystem:
fileSystem
,
);
final
LinuxPlugin
linuxPlugin
=
plugin
.
platforms
[
LinuxPlugin
.
kConfigKey
]
as
LinuxPlugin
;
final
MacOSPlugin
macOSPlugin
=
plugin
.
platforms
[
MacOSPlugin
.
kConfigKey
]
as
MacOSPlugin
;
final
WindowsPlugin
windowsPlugin
=
plugin
.
platforms
[
WindowsPlugin
.
kConfigKey
]
as
WindowsPlugin
;
final
LinuxPlugin
linuxPlugin
=
plugin
.
platforms
[
LinuxPlugin
.
kConfigKey
]
!
as
LinuxPlugin
;
final
MacOSPlugin
macOSPlugin
=
plugin
.
platforms
[
MacOSPlugin
.
kConfigKey
]
!
as
MacOSPlugin
;
final
WindowsPlugin
windowsPlugin
=
plugin
.
platforms
[
WindowsPlugin
.
kConfigKey
]
!
as
WindowsPlugin
;
expect
(
linuxPlugin
.
pluginClass
,
isNull
);
expect
(
macOSPlugin
.
pluginClass
,
isNull
);
...
...
@@ -224,7 +222,7 @@ void main() {
testWithoutContext
(
'Plugin parsing throws a fatal error on an empty plugin'
,
()
{
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
YamlMap
pluginYaml
=
loadYaml
(
''
)
as
YamlMap
;
final
YamlMap
?
pluginYaml
=
loadYaml
(
''
)
as
YamlMap
?
;
expect
(
()
=>
Plugin
.
fromYaml
(
...
...
packages/flutter_tools/test/general.shard/plugins_test.dart
View file @
d40cc5af
...
...
@@ -14,6 +14,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/base/time.dart'
;
import
'package:flutter_tools/src/base/utils.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/flutter_plugins.dart'
;
import
'package:flutter_tools/src/globals_null_migrated.dart'
as
globals
;
import
'package:flutter_tools/src/ios/xcodeproj.dart'
;
import
'package:flutter_tools/src/plugins.dart'
;
...
...
packages/flutter_tools/test/general.shard/windows/plugins_test.dart
View file @
d40cc5af
...
...
@@ -8,6 +8,7 @@ import 'package:file/file.dart';
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/template.dart'
;
import
'package:flutter_tools/src/flutter_plugins.dart'
;
import
'package:flutter_tools/src/isolated/mustache_template.dart'
;
import
'package:flutter_tools/src/platform_plugins.dart'
;
import
'package:flutter_tools/src/plugins.dart'
;
...
...
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