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
e6535f6d
Unverified
Commit
e6535f6d
authored
Aug 26, 2021
by
Jenn Magder
Committed by
GitHub
Aug 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed tool cached properties to late finals (#88923)
parent
c690f143
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
51 deletions
+26
-51
android_sdk.dart
packages/flutter_tools/lib/src/android/android_sdk.dart
+1
-2
cache.dart
packages/flutter_tools/lib/src/cache.dart
+1
-2
cmake_project.dart
packages/flutter_tools/lib/src/cmake_project.dart
+2
-4
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+1
-2
platform_plugins.dart
packages/flutter_tools/lib/src/platform_plugins.dart
+1
-3
project.dart
packages/flutter_tools/lib/src/project.dart
+9
-18
font_config_manager.dart
packages/flutter_tools/lib/src/test/font_config_manager.dart
+6
-11
visual_studio.dart
packages/flutter_tools/lib/src/windows/visual_studio.dart
+5
-9
No files found.
packages/flutter_tools/lib/src/android/android_sdk.dart
View file @
e6535f6d
...
@@ -169,8 +169,7 @@ class AndroidSdk {
...
@@ -169,8 +169,7 @@ class AndroidSdk {
AndroidSdkVersion
?
get
latestVersion
=>
_latestVersion
;
AndroidSdkVersion
?
get
latestVersion
=>
_latestVersion
;
String
?
get
adbPath
=>
_adbPath
??=
getPlatformToolsPath
(
globals
.
platform
.
isWindows
?
'adb.exe'
:
'adb'
);
late
final
String
?
adbPath
=
getPlatformToolsPath
(
globals
.
platform
.
isWindows
?
'adb.exe'
:
'adb'
);
String
?
_adbPath
;
String
?
get
emulatorPath
=>
getEmulatorPath
();
String
?
get
emulatorPath
=>
getEmulatorPath
();
...
...
packages/flutter_tools/lib/src/cache.dart
View file @
e6535f6d
...
@@ -163,8 +163,7 @@ class Cache {
...
@@ -163,8 +163,7 @@ class Cache {
final
Net
_net
;
final
Net
_net
;
final
FileSystemUtils
_fsUtils
;
final
FileSystemUtils
_fsUtils
;
ArtifactUpdater
get
_artifactUpdater
=>
__artifactUpdater
??=
_createUpdater
();
late
final
ArtifactUpdater
_artifactUpdater
=
_createUpdater
();
ArtifactUpdater
?
__artifactUpdater
;
@protected
@protected
void
registerArtifact
(
ArtifactSet
artifactSet
)
{
void
registerArtifact
(
ArtifactSet
artifactSet
)
{
...
...
packages/flutter_tools/lib/src/cmake_project.dart
View file @
e6535f6d
...
@@ -97,13 +97,11 @@ class WindowsUwpProject extends WindowsProject {
...
@@ -97,13 +97,11 @@ class WindowsUwpProject extends WindowsProject {
int
?
get
projectVersion
=>
int
.
tryParse
(
_editableDirectory
.
childFile
(
'project_version'
).
readAsStringSync
());
int
?
get
projectVersion
=>
int
.
tryParse
(
_editableDirectory
.
childFile
(
'project_version'
).
readAsStringSync
());
/// Retrieve the GUID of the UWP package.
/// Retrieve the GUID of the UWP package.
String
?
get
packageGuid
=>
_packageGuid
??=
getCmakePackageGuid
(
runnerCmakeFile
);
late
final
String
?
packageGuid
=
getCmakePackageGuid
(
runnerCmakeFile
);
String
?
_packageGuid
;
File
get
appManifest
=>
_editableDirectory
.
childDirectory
(
'runner_uwp'
).
childFile
(
'appxmanifest.in'
);
File
get
appManifest
=>
_editableDirectory
.
childDirectory
(
'runner_uwp'
).
childFile
(
'appxmanifest.in'
);
String
?
get
packageVersion
=>
_packageVersion
??=
parseAppVersion
(
this
);
late
final
String
?
packageVersion
=
parseAppVersion
(
this
);
String
?
_packageVersion
;
}
}
@visibleForTesting
@visibleForTesting
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
e6535f6d
...
@@ -50,8 +50,7 @@ class IMobileDevice {
...
@@ -50,8 +50,7 @@ class IMobileDevice {
final
ProcessManager
_processManager
;
final
ProcessManager
_processManager
;
final
ProcessUtils
_processUtils
;
final
ProcessUtils
_processUtils
;
bool
get
isInstalled
=>
_isInstalled
??=
_processManager
.
canRun
(
_idevicescreenshotPath
);
late
final
bool
isInstalled
=
_processManager
.
canRun
(
_idevicescreenshotPath
);
bool
?
_isInstalled
;
/// Starts `idevicesyslog` and returns the running process.
/// Starts `idevicesyslog` and returns the running process.
Future
<
Process
>
startLogger
(
String
deviceID
)
{
Future
<
Process
>
startLogger
(
String
deviceID
)
{
...
...
packages/flutter_tools/lib/src/platform_plugins.dart
View file @
e6535f6d
...
@@ -106,10 +106,8 @@ class AndroidPlugin extends PluginPlatform {
...
@@ -106,10 +106,8 @@ class AndroidPlugin extends PluginPlatform {
};
};
}
}
Set
<
String
>?
_cachedEmbeddingVersion
;
/// Returns the version of the Android embedding.
/// Returns the version of the Android embedding.
Set
<
String
>
get
_supportedEmbeddings
=>
_cachedEmbeddingVersion
??
=
_getSupportedEmbeddings
();
late
final
Set
<
String
>
_supportedEmbeddings
=
_getSupportedEmbeddings
();
Set
<
String
>
_getSupportedEmbeddings
()
{
Set
<
String
>
_getSupportedEmbeddings
()
{
assert
(
pluginPath
!=
null
);
assert
(
pluginPath
!=
null
);
...
...
packages/flutter_tools/lib/src/project.dart
View file @
e6535f6d
...
@@ -163,36 +163,28 @@ class FlutterProject {
...
@@ -163,36 +163,28 @@ class FlutterProject {
}
}
/// The iOS sub project of this project.
/// The iOS sub project of this project.
IosProject
?
_ios
;
late
final
IosProject
ios
=
IosProject
.
fromFlutter
(
this
);
IosProject
get
ios
=>
_ios
??=
IosProject
.
fromFlutter
(
this
);
/// The Android sub project of this project.
/// The Android sub project of this project.
AndroidProject
?
_android
;
late
final
AndroidProject
android
=
AndroidProject
.
_
(
this
);
AndroidProject
get
android
=>
_android
??=
AndroidProject
.
_
(
this
);
/// The web sub project of this project.
/// The web sub project of this project.
WebProject
?
_web
;
late
final
WebProject
web
=
WebProject
.
_
(
this
);
WebProject
get
web
=>
_web
??=
WebProject
.
_
(
this
);
/// The MacOS sub project of this project.
/// The MacOS sub project of this project.
MacOSProject
?
_macos
;
late
final
MacOSProject
macos
=
MacOSProject
.
fromFlutter
(
this
);
MacOSProject
get
macos
=>
_macos
??=
MacOSProject
.
fromFlutter
(
this
);
/// The Linux sub project of this project.
/// The Linux sub project of this project.
LinuxProject
?
_linux
;
late
final
LinuxProject
linux
=
LinuxProject
.
fromFlutter
(
this
);
LinuxProject
get
linux
=>
_linux
??=
LinuxProject
.
fromFlutter
(
this
);
/// The Windows sub project of this project.
/// The Windows sub project of this project.
WindowsProject
?
_windows
;
late
final
WindowsProject
windows
=
WindowsProject
.
fromFlutter
(
this
);
WindowsProject
get
windows
=>
_windows
??=
WindowsProject
.
fromFlutter
(
this
);
/// The Windows UWP sub project of this project.
/// The Windows UWP sub project of this project.
WindowsUwpProject
?
_windowUwp
;
late
final
WindowsUwpProject
windowsUwp
=
WindowsUwpProject
.
fromFlutter
(
this
);
WindowsUwpProject
get
windowsUwp
=>
_windowUwp
??=
WindowsUwpProject
.
fromFlutter
(
this
);
/// The Fuchsia sub project of this project.
/// The Fuchsia sub project of this project.
FuchsiaProject
?
_fuchsia
;
late
final
FuchsiaProject
fuchsia
=
FuchsiaProject
.
_
(
this
);
FuchsiaProject
get
fuchsia
=>
_fuchsia
??=
FuchsiaProject
.
_
(
this
);
/// The `pubspec.yaml` file of this project.
/// The `pubspec.yaml` file of this project.
File
get
pubspecFile
=>
directory
.
childFile
(
'pubspec.yaml'
);
File
get
pubspecFile
=>
directory
.
childFile
(
'pubspec.yaml'
);
...
@@ -414,8 +406,7 @@ class AndroidProject extends FlutterProjectPlatform {
...
@@ -414,8 +406,7 @@ class AndroidProject extends FlutterProjectPlatform {
bool
get
usesAndroidX
=>
parent
.
usesAndroidX
;
bool
get
usesAndroidX
=>
parent
.
usesAndroidX
;
/// Returns true if the current version of the Gradle plugin is supported.
/// Returns true if the current version of the Gradle plugin is supported.
bool
get
isSupportedVersion
=>
_isSupportedVersion
??=
_computeSupportedVersion
();
late
final
bool
isSupportedVersion
=
_computeSupportedVersion
();
bool
?
_isSupportedVersion
;
bool
_computeSupportedVersion
()
{
bool
_computeSupportedVersion
()
{
final
FileSystem
fileSystem
=
hostAppGradleRoot
.
fileSystem
;
final
FileSystem
fileSystem
=
hostAppGradleRoot
.
fileSystem
;
...
...
packages/flutter_tools/lib/src/test/font_config_manager.dart
View file @
e6535f6d
...
@@ -10,15 +10,10 @@ import '../globals_null_migrated.dart' as globals;
...
@@ -10,15 +10,10 @@ import '../globals_null_migrated.dart' as globals;
/// Manages a Font configuration that can be shared across multiple tests.
/// Manages a Font configuration that can be shared across multiple tests.
class
FontConfigManager
{
class
FontConfigManager
{
Directory
?
_fontsDirectory
;
Directory
?
_fontsDirectory
;
File
?
_cachedFontConfig
;
/// Returns a Font configuration that limits font fallback to the artifact
/// Returns a Font configuration that limits font fallback to the artifact
/// cache directory.
/// cache directory.
File
get
fontConfigFile
{
late
final
File
fontConfigFile
=
(){
if
(
_cachedFontConfig
!=
null
)
{
return
_cachedFontConfig
!;
}
final
StringBuffer
sb
=
StringBuffer
();
final
StringBuffer
sb
=
StringBuffer
();
sb
.
writeln
(
'<fontconfig>'
);
sb
.
writeln
(
'<fontconfig>'
);
sb
.
writeln
(
' <dir>
${globals.cache.getCacheArtifacts().path}
</dir>'
);
sb
.
writeln
(
' <dir>
${globals.cache.getCacheArtifacts().path}
</dir>'
);
...
@@ -30,11 +25,11 @@ class FontConfigManager {
...
@@ -30,11 +25,11 @@ class FontConfigManager {
globals
.
printTrace
(
'Using this directory for fonts configuration:
${_fontsDirectory!.path}
'
);
globals
.
printTrace
(
'Using this directory for fonts configuration:
${_fontsDirectory!.path}
'
);
}
}
_
cachedFontConfig
=
globals
.
fs
.
file
(
'
${_fontsDirectory!.path}
/fonts.conf'
);
final
File
cachedFontConfig
=
globals
.
fs
.
file
(
'
${_fontsDirectory!.path}
/fonts.conf'
);
_cachedFontConfig
!
.
createSync
();
cachedFontConfig
.
createSync
();
_cachedFontConfig
!
.
writeAsStringSync
(
sb
.
toString
());
cachedFontConfig
.
writeAsStringSync
(
sb
.
toString
());
return
_cachedFontConfig
!
;
return
cachedFontConfig
;
}
}
();
Future
<
void
>
dispose
()
async
{
Future
<
void
>
dispose
()
async
{
if
(
_fontsDirectory
!=
null
)
{
if
(
_fontsDirectory
!=
null
)
{
...
...
packages/flutter_tools/lib/src/windows/visual_studio.dart
View file @
e6535f6d
...
@@ -348,11 +348,7 @@ class VisualStudio {
...
@@ -348,11 +348,7 @@ class VisualStudio {
///
///
/// If no installation is found, the cached VS details are set to an empty map
/// If no installation is found, the cached VS details are set to an empty map
/// to avoid repeating vswhere queries that have already not found an installation.
/// to avoid repeating vswhere queries that have already not found an installation.
Map
<
String
,
dynamic
>?
_cachedUsableVisualStudioDetails
;
late
final
Map
<
String
,
dynamic
>
_usableVisualStudioDetails
=
(){
Map
<
String
,
dynamic
>
get
_usableVisualStudioDetails
{
if
(
_cachedUsableVisualStudioDetails
!=
null
)
{
return
_cachedUsableVisualStudioDetails
!;
}
final
List
<
String
>
minimumVersionArguments
=
<
String
>[
final
List
<
String
>
minimumVersionArguments
=
<
String
>[
_vswhereMinVersionArgument
,
_vswhereMinVersionArgument
,
_minimumSupportedVersion
.
toString
(),
_minimumSupportedVersion
.
toString
(),
...
@@ -370,16 +366,16 @@ class VisualStudio {
...
@@ -370,16 +366,16 @@ class VisualStudio {
}
}
}
}
Map
<
String
,
dynamic
>?
usableVisualStudioDetails
;
if
(
visualStudioDetails
!=
null
)
{
if
(
visualStudioDetails
!=
null
)
{
if
(
installationHasIssues
(
visualStudioDetails
))
{
if
(
installationHasIssues
(
visualStudioDetails
))
{
_cachedAnyVisualStudioDetails
=
visualStudioDetails
;
_cachedAnyVisualStudioDetails
=
visualStudioDetails
;
}
else
{
}
else
{
_cachedU
sableVisualStudioDetails
=
visualStudioDetails
;
u
sableVisualStudioDetails
=
visualStudioDetails
;
}
}
}
}
_cachedUsableVisualStudioDetails
??=
<
String
,
dynamic
>{};
return
usableVisualStudioDetails
??
<
String
,
dynamic
>{};
return
_cachedUsableVisualStudioDetails
!;
}();
}
/// Returns the details dictionary of the latest version of Visual Studio,
/// Returns the details dictionary of the latest version of Visual Studio,
/// regardless of components and version, or {} if no such installation is
/// regardless of components and version, or {} if no such installation is
...
...
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