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
2d836a99
Unverified
Commit
2d836a99
authored
Nov 14, 2020
by
Greg Spencer
Committed by
GitHub
Nov 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some unnecessary casts, now that changes have rolled from the engine (#70491)
parent
6e84a142
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
widgets_test.dart
packages/flutter_localizations/test/widgets_test.dart
+2
-5
window.dart
packages/flutter_test/lib/src/window.dart
+2
-4
No files found.
packages/flutter_localizations/test/widgets_test.dart
View file @
2d836a99
...
@@ -689,11 +689,8 @@ void main() {
...
@@ -689,11 +689,8 @@ void main() {
const
OnlyRTLDefaultWidgetsLocalizationsDelegate
(),
const
OnlyRTLDefaultWidgetsLocalizationsDelegate
(),
],
],
buildContent:
(
BuildContext
context
)
{
buildContent:
(
BuildContext
context
)
{
// TODO(gspencergood): remove the casts once
final
Locale
locale1
=
ui
.
window
.
locales
.
first
;
// https://github.com/flutter/engine/pull/22473 rolls into the
final
Locale
locale2
=
ui
.
window
.
locales
[
1
];
// framework.
final
Locale
locale1
=
((
ui
.
window
.
locales
as
dynamic
)
as
List
<
Locale
>).
first
;
final
Locale
locale2
=
((
ui
.
window
.
locales
as
dynamic
)
as
List
<
Locale
>)[
1
];
return
Text
(
'
$locale1
$locale2
'
);
return
Text
(
'
$locale1
$locale2
'
);
},
},
)
)
...
...
packages/flutter_test/lib/src/window.dart
View file @
2d836a99
...
@@ -154,8 +154,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
...
@@ -154,8 +154,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
}
}
@override
@override
// TODO(gspencergoog): remove the casts once https://github.com/flutter/engine/pull/22267 lands
ui
.
Locale
get
locale
=>
_localeTestValue
??
platformDispatcher
.
locale
;
ui
.
Locale
get
locale
=>
_localeTestValue
??
((
platformDispatcher
.
locale
as
dynamic
)
as
ui
.
Locale
);
ui
.
Locale
?
_localeTestValue
;
ui
.
Locale
?
_localeTestValue
;
/// Hides the real locale and reports the given [localeTestValue] instead.
/// Hides the real locale and reports the given [localeTestValue] instead.
set
localeTestValue
(
ui
.
Locale
localeTestValue
)
{
set
localeTestValue
(
ui
.
Locale
localeTestValue
)
{
...
@@ -169,8 +168,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
...
@@ -169,8 +168,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
}
}
@override
@override
// TODO(gspencergoog): remove the casts once https://github.com/flutter/engine/pull/22267 lands
List
<
ui
.
Locale
>
get
locales
=>
_localesTestValue
??
platformDispatcher
.
locales
;
List
<
ui
.
Locale
>
get
locales
=>
_localesTestValue
??
((
platformDispatcher
.
locales
as
dynamic
)
as
List
<
ui
.
Locale
>);
List
<
ui
.
Locale
>?
_localesTestValue
;
List
<
ui
.
Locale
>?
_localesTestValue
;
/// Hides the real locales and reports the given [localesTestValue] instead.
/// Hides the real locales and reports the given [localesTestValue] instead.
set
localesTestValue
(
List
<
ui
.
Locale
>
localesTestValue
)
{
set
localesTestValue
(
List
<
ui
.
Locale
>
localesTestValue
)
{
...
...
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