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
291b2864
Unverified
Commit
291b2864
authored
Mar 09, 2022
by
Chris Yang
Committed by
GitHub
Mar 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tool] Add CADisableMinimumFrameDurationOnPhone to iOS templates (#94509)
parent
0aab2280
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
Info.plist.tmpl
...ools/templates/app_shared/ios.tmpl/Runner/Info.plist.tmpl
+2
-0
Info.plist.tmpl
...module/ios/host_app_ephemeral/Runner.tmpl/Info.plist.tmpl
+2
-0
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+25
-6
No files found.
packages/flutter_tools/templates/app_shared/ios.tmpl/Runner/Info.plist.tmpl
View file @
291b2864
...
...
@@ -43,5 +43,7 @@
</array>
<key>
UIViewControllerBasedStatusBarAppearance
</key>
<false/>
<key>
CADisableMinimumFrameDurationOnPhone
</key>
<true/>
</dict>
</plist>
packages/flutter_tools/templates/module/ios/host_app_ephemeral/Runner.tmpl/Info.plist.tmpl
View file @
291b2864
...
...
@@ -43,5 +43,7 @@
</array>
<key>
UIViewControllerBasedStatusBarAppearance
</key>
<false/>
<key>
CADisableMinimumFrameDurationOnPhone
</key>
<true/>
</dict>
</plist>
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
291b2864
...
...
@@ -1368,7 +1368,7 @@ void main() {
ProcessManager:
()
=>
fakeProcessManager
,
});
testUsingContext
(
'
display name is Title Case
for objc iOS project.'
,
()
async
{
testUsingContext
(
'
Correct info.plist key-value pairs
for objc iOS project.'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
...
...
@@ -1379,11 +1379,13 @@ void main() {
final
String
plistPath
=
globals
.
fs
.
path
.
join
(
'ios'
,
'Runner'
,
'Info.plist'
);
final
File
plistFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
projectDir
.
path
,
plistPath
));
expect
(
plistFile
,
exists
);
final
bool
disabled
=
_getBooleanValueFromPlist
(
plistFile:
plistFile
,
key:
'CADisableMinimumFrameDurationOnPhone'
);
expect
(
disabled
,
isTrue
);
final
String
displayName
=
_getStringValueFromPlist
(
plistFile:
plistFile
,
key:
'CFBundleDisplayName'
);
expect
(
displayName
,
'My Project'
);
});
testUsingContext
(
'
display name is Title Case for swift iOS
project.'
,
()
async
{
testUsingContext
(
'
Correct info.plist key-value pairs for objc swift
project.'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
...
...
@@ -1394,11 +1396,13 @@ void main() {
final
String
plistPath
=
globals
.
fs
.
path
.
join
(
'ios'
,
'Runner'
,
'Info.plist'
);
final
File
plistFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
projectDir
.
path
,
plistPath
));
expect
(
plistFile
,
exists
);
final
bool
disabled
=
_getBooleanValueFromPlist
(
plistFile:
plistFile
,
key:
'CADisableMinimumFrameDurationOnPhone'
);
expect
(
disabled
,
isTrue
);
final
String
displayName
=
_getStringValueFromPlist
(
plistFile:
plistFile
,
key:
'CFBundleDisplayName'
);
expect
(
displayName
,
'My Project'
);
});
testUsingContext
(
'
display name is Title Case
for objc iOS module.'
,
()
async
{
testUsingContext
(
'
Correct info.plist key-value pairs
for objc iOS module.'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
...
...
@@ -1409,6 +1413,8 @@ void main() {
final
String
plistPath
=
globals
.
fs
.
path
.
join
(
'.ios'
,
'Runner'
,
'Info.plist'
);
final
File
plistFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
projectDir
.
path
,
plistPath
));
expect
(
plistFile
,
exists
);
final
bool
disabled
=
_getBooleanValueFromPlist
(
plistFile:
plistFile
,
key:
'CADisableMinimumFrameDurationOnPhone'
);
expect
(
disabled
,
isTrue
);
final
String
displayName
=
_getStringValueFromPlist
(
plistFile:
plistFile
,
key:
'CFBundleDisplayName'
);
expect
(
displayName
,
'My Project'
);
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -1422,7 +1428,7 @@ void main() {
),
});
testUsingContext
(
'
display name is Title Case
for swift iOS module.'
,
()
async
{
testUsingContext
(
'
Correct info.plist key-value pairs
for swift iOS module.'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
...
...
@@ -1433,6 +1439,8 @@ void main() {
final
String
plistPath
=
globals
.
fs
.
path
.
join
(
'.ios'
,
'Runner'
,
'Info.plist'
);
final
File
plistFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
projectDir
.
path
,
plistPath
));
expect
(
plistFile
,
exists
);
final
bool
disabled
=
_getBooleanValueFromPlist
(
plistFile:
plistFile
,
key:
'CADisableMinimumFrameDurationOnPhone'
);
expect
(
disabled
,
isTrue
);
final
String
displayName
=
_getStringValueFromPlist
(
plistFile:
plistFile
,
key:
'CFBundleDisplayName'
);
expect
(
displayName
,
'My Project'
);
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -1446,7 +1454,7 @@ void main() {
),
});
testUsingContext
(
'
display name is Title Case
for swift iOS plugin.'
,
()
async
{
testUsingContext
(
'
Correct info.plist key-value pairs
for swift iOS plugin.'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
...
...
@@ -1457,11 +1465,13 @@ void main() {
final
String
plistPath
=
globals
.
fs
.
path
.
join
(
'example'
,
'ios'
,
'Runner'
,
'Info.plist'
);
final
File
plistFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
projectDir
.
path
,
plistPath
));
expect
(
plistFile
,
exists
);
final
bool
disabled
=
_getBooleanValueFromPlist
(
plistFile:
plistFile
,
key:
'CADisableMinimumFrameDurationOnPhone'
);
expect
(
disabled
,
isTrue
);
final
String
displayName
=
_getStringValueFromPlist
(
plistFile:
plistFile
,
key:
'CFBundleDisplayName'
);
expect
(
displayName
,
'My Project'
);
});
testUsingContext
(
'
display name is Title Case
for objc iOS plugin.'
,
()
async
{
testUsingContext
(
'
Correct info.plist key-value pairs
for objc iOS plugin.'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
...
...
@@ -1472,6 +1482,8 @@ void main() {
final
String
plistPath
=
globals
.
fs
.
path
.
join
(
'example'
,
'ios'
,
'Runner'
,
'Info.plist'
);
final
File
plistFile
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
projectDir
.
path
,
plistPath
));
expect
(
plistFile
,
exists
);
final
bool
disabled
=
_getBooleanValueFromPlist
(
plistFile:
plistFile
,
key:
'CADisableMinimumFrameDurationOnPhone'
);
expect
(
disabled
,
isTrue
);
final
String
displayName
=
_getStringValueFromPlist
(
plistFile:
plistFile
,
key:
'CFBundleDisplayName'
);
expect
(
displayName
,
'My Project'
);
});
...
...
@@ -3161,3 +3173,10 @@ String _getStringValueFromPlist({File plistFile, String key}) {
assert
(
keyIndex
>
0
);
return
plist
[
keyIndex
+
1
].
replaceAll
(
'<string>'
,
''
).
replaceAll
(
'</string>'
,
''
);
}
bool
_getBooleanValueFromPlist
(
{
File
plistFile
,
String
key
})
{
final
List
<
String
>
plist
=
plistFile
.
readAsLinesSync
().
map
((
String
line
)
=>
line
.
trim
()).
toList
();
final
int
keyIndex
=
plist
.
indexOf
(
'<key>
$key
</key>'
);
assert
(
keyIndex
>
0
);
return
plist
[
keyIndex
+
1
].
replaceAll
(
'<'
,
''
).
replaceAll
(
'/>'
,
''
)
==
'true'
;
}
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