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
78db9656
Commit
78db9656
authored
Dec 19, 2019
by
Alexandre Ardhuin
Committed by
Flutter GitHub Bot
Dec 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reland implicit-casts: false (#47431)
parent
4af66e33
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
51 additions
and
100 deletions
+51
-100
analysis_options.yaml
analysis_options.yaml
+1
-0
fast_scroll_large_images__memory.dart
...devicelab/bin/tasks/fast_scroll_large_images__memory.dart
+1
-1
driver_screenshot_tester.dart
...screenshot_test/test_driver/driver_screenshot_tester.dart
+4
-4
gen_l10n.dart
dev/tools/localization/bin/gen_l10n.dart
+4
-4
gen_l10n.dart
dev/tools/localization/gen_l10n.dart
+8
-9
mouse_tracking.dart
packages/flutter/lib/src/gestures/mouse_tracking.dart
+1
-1
reorderable_list.dart
packages/flutter/lib/src/material/reorderable_list.dart
+1
-1
edge_insets.dart
packages/flutter/lib/src/painting/edge_insets.dart
+6
-6
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+2
-2
proxy_sliver.dart
packages/flutter/lib/src/rendering/proxy_sliver.dart
+3
-2
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+1
-1
drag_target.dart
packages/flutter/lib/src/widgets/drag_target.dart
+9
-10
draggable_test.dart
packages/flutter/test/widgets/draggable_test.dart
+10
-2
analysis_options.yaml
packages/flutter_driver/analysis_options.yaml
+0
-8
analysis_options.yaml
packages/flutter_goldens/analysis_options.yaml
+0
-5
analysis_options.yaml
packages/flutter_goldens_client/analysis_options.yaml
+0
-5
analysis_options.yaml
packages/flutter_localizations/analysis_options.yaml
+0
-12
analysis_options.yaml
packages/flutter_test/analysis_options.yaml
+0
-6
analysis_options.yaml
packages/flutter_tools/analysis_options.yaml
+0
-5
analysis_options.yaml
packages/flutter_web_plugins/analysis_options.yaml
+0
-8
analysis_options.yaml
packages/fuchsia_remote_debug_protocol/analysis_options.yaml
+0
-8
No files found.
analysis_options.yaml
View file @
78db9656
...
...
@@ -20,6 +20,7 @@
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
errors
:
# treat missing required parameters as a warning (not a hint)
...
...
dev/devicelab/bin/tasks/fast_scroll_large_images__memory.dart
View file @
78db9656
...
...
@@ -20,7 +20,7 @@ class FastScrollLargeImagesMemoryTest extends MemoryTest {
);
@override
AndroidDevice
get
device
=>
super
.
device
;
AndroidDevice
get
device
=>
super
.
device
as
AndroidDevice
;
@override
int
get
iterationCount
=>
5
;
...
...
dev/integration_tests/flutter_driver_screenshot_test/test_driver/driver_screenshot_tester.dart
View file @
78db9656
...
...
@@ -4,10 +4,11 @@
import
'dart:async'
;
import
'dart:io'
show
File
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:meta/meta.dart'
;
import
'package:path/path.dart'
as
path
;
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:collection/collection.dart'
;
const
String
_kPathParent
=
'test_driver/goldens/'
;
...
...
@@ -43,8 +44,7 @@ class DriverScreenShotTester {
Future
<
bool
>
compareScreenshots
(
List
<
int
>
screenshot
)
async
{
final
File
file
=
File
(
_getImageFilePath
());
final
List
<
int
>
matcher
=
await
file
.
readAsBytes
();
final
Function
listEquals
=
const
ListEquality
<
int
>().
equals
;
return
listEquals
(
screenshot
,
matcher
);
return
listEquals
<
int
>(
screenshot
,
matcher
);
}
/// Returns a bytes representation of a screenshot on the current screen.
...
...
dev/tools/localization/bin/gen_l10n.dart
View file @
78db9656
...
...
@@ -53,10 +53,10 @@ Future<void> main(List<String> arguments) async {
exit
(
0
);
}
final
String
arbPathString
=
results
[
'arb-dir'
];
final
String
outputFileString
=
results
[
'output-localization-file'
];
final
String
templateArbFileName
=
results
[
'template-arb-file'
];
final
String
classNameString
=
results
[
'output-class'
];
final
String
arbPathString
=
results
[
'arb-dir'
]
as
String
;
final
String
outputFileString
=
results
[
'output-localization-file'
]
as
String
;
final
String
templateArbFileName
=
results
[
'template-arb-file'
]
as
String
;
final
String
classNameString
=
results
[
'output-class'
]
as
String
;
const
local
.
LocalFileSystem
fs
=
local
.
LocalFileSystem
();
final
LocalizationsGenerator
localizationsGenerator
=
LocalizationsGenerator
(
fs
);
...
...
dev/tools/localization/gen_l10n.dart
View file @
78db9656
...
...
@@ -214,10 +214,7 @@ const Set<String> allowableDateFormats = <String>{
's'
,
};
bool
_isDateParameter
(
dynamic
placeholderValue
)
{
return
placeholderValue
is
Map
<
String
,
dynamic
>
&&
placeholderValue
[
'type'
]
==
'DateTime'
;
}
bool
_isDateParameter
(
Map
<
String
,
dynamic
>
placeholderValue
)
=>
placeholderValue
[
'type'
]
==
'DateTime'
;
bool
_dateParameterIsValid
(
Map
<
String
,
dynamic
>
placeholderValue
,
String
placeholder
)
{
if
(
allowableDateFormats
.
contains
(
placeholderValue
[
'format'
]))
...
...
@@ -260,6 +257,7 @@ String generateDateFormattingLogic(Map<String, dynamic> bundle, String key) {
for
(
String
placeholder
in
placeholders
.
keys
)
{
final
dynamic
value
=
placeholders
[
placeholder
];
if
(
value
is
Map
<
String
,
dynamic
>
&&
_isDateParameter
(
value
)
&&
_containsFormatKey
(
value
,
placeholder
)
&&
_dateParameterIsValid
(
value
,
placeholder
)
...
...
@@ -291,6 +289,7 @@ List<String> genIntlMethodArgs(Map<String, dynamic> bundle, String key) {
for
(
String
placeholder
in
placeholders
.
keys
)
{
final
dynamic
value
=
placeholders
[
placeholder
];
if
(
value
is
Map
<
String
,
dynamic
>
&&
_isDateParameter
(
value
)
&&
_containsFormatKey
(
value
,
placeholder
)
&&
_dateParameterIsValid
(
value
,
placeholder
)
...
...
@@ -315,7 +314,7 @@ String genSimpleMethod(Map<String, dynamic> bundle, String key) {
final
Map
<
String
,
dynamic
>
placeholders
=
attributesMap
[
'placeholders'
]
as
Map
<
String
,
dynamic
>;
for
(
String
placeholder
in
placeholders
.
keys
)
{
final
dynamic
value
=
placeholders
[
placeholder
];
if
(
_isDateParameter
(
value
))
{
if
(
value
is
Map
<
String
,
dynamic
>
&&
_isDateParameter
(
value
))
{
message
=
message
.
replaceAll
(
'{
$placeholder
}'
,
'
\$
${placeholder}
String'
);
}
else
{
message
=
message
.
replaceAll
(
'{
$placeholder
}'
,
'
\$
$placeholder
'
);
...
...
@@ -599,8 +598,8 @@ class LocalizationsGenerator {
for
(
File
file
in
fileSystemEntityList
)
{
final
String
filePath
=
file
.
path
;
if
(
arbFilenameRE
.
hasMatch
(
filePath
))
{
final
Map
<
String
,
dynamic
>
arbContents
=
json
.
decode
(
file
.
readAsStringSync
());
String
localeString
=
arbContents
[
'@@locale'
];
final
Map
<
String
,
dynamic
>
arbContents
=
json
.
decode
(
file
.
readAsStringSync
())
as
Map
<
String
,
dynamic
>
;
String
localeString
=
arbContents
[
'@@locale'
]
as
String
;
if
(
localeString
==
null
)
{
final
RegExpMatch
arbFileMatch
=
arbFilenameLocaleRE
.
firstMatch
(
filePath
);
if
(
arbFileMatch
==
null
)
{
...
...
@@ -653,7 +652,7 @@ class LocalizationsGenerator {
void
generateClassMethods
()
{
Map
<
String
,
dynamic
>
bundle
;
try
{
bundle
=
json
.
decode
(
templateArbFile
.
readAsStringSync
());
bundle
=
json
.
decode
(
templateArbFile
.
readAsStringSync
())
as
Map
<
String
,
dynamic
>
;
}
on
FileSystemException
catch
(
e
)
{
throw
FileSystemException
(
'Unable to read input arb file:
$e
'
);
}
on
FormatException
catch
(
e
)
{
...
...
@@ -669,7 +668,7 @@ class LocalizationsGenerator {
'Invalid key format:
$key
\n
It has to be in camel case, cannot start '
'with a number, and cannot contain non-alphanumeric characters.'
);
if
(
pluralValueRE
.
hasMatch
(
bundle
[
key
]))
if
(
pluralValueRE
.
hasMatch
(
bundle
[
key
]
as
String
))
classMethods
.
add
(
genPluralMethod
(
bundle
,
key
));
else
classMethods
.
add
(
genSimpleMethod
(
bundle
,
key
));
...
...
packages/flutter/lib/src/gestures/mouse_tracking.dart
View file @
78db9656
...
...
@@ -314,7 +314,7 @@ class MouseTracker extends ChangeNotifier {
final
int
device
=
state
.
device
;
return
(
_mouseStates
.
containsKey
(
device
)
&&
_trackedAnnotations
.
isNotEmpty
)
?
LinkedHashSet
<
MouseTrackerAnnotation
>.
from
(
annotationFinder
(
globalPosition
))
:
<
MouseTrackerAnnotation
>{};
:
<
MouseTrackerAnnotation
>{}
as
LinkedHashSet
<
MouseTrackerAnnotation
>
;
}
static
bool
get
_duringBuildPhase
{
...
...
packages/flutter/lib/src/material/reorderable_list.dart
View file @
78db9656
...
...
@@ -530,7 +530,7 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T
return
_dragging
==
toAccept
&&
toAccept
!=
toWrap
.
key
;
},
onAccept:
(
Key
accepted
)
{
},
onLeave:
(
Key
leaving
)
{
},
onLeave:
(
Object
leaving
)
{
},
);
});
}
...
...
packages/flutter/lib/src/painting/edge_insets.dart
View file @
78db9656
...
...
@@ -162,12 +162,12 @@ abstract class EdgeInsetsGeometry {
/// or equal to `min`, and less than or equal to `max`.
EdgeInsetsGeometry
clamp
(
EdgeInsetsGeometry
min
,
EdgeInsetsGeometry
max
)
{
return
_MixedEdgeInsets
.
fromLRSETB
(
_left
.
clamp
(
min
.
_left
,
max
.
_left
),
_right
.
clamp
(
min
.
_right
,
max
.
_right
),
_start
.
clamp
(
min
.
_start
,
max
.
_start
),
_end
.
clamp
(
min
.
_end
,
max
.
_end
),
_top
.
clamp
(
min
.
_top
,
max
.
_top
),
_bottom
.
clamp
(
min
.
_bottom
,
max
.
_bottom
),
_left
.
clamp
(
min
.
_left
,
max
.
_left
)
as
double
,
_right
.
clamp
(
min
.
_right
,
max
.
_right
)
as
double
,
_start
.
clamp
(
min
.
_start
,
max
.
_start
)
as
double
,
_end
.
clamp
(
min
.
_end
,
max
.
_end
)
as
double
,
_top
.
clamp
(
min
.
_top
,
max
.
_top
)
as
double
,
_bottom
.
clamp
(
min
.
_bottom
,
max
.
_bottom
)
as
double
,
);
}
...
...
packages/flutter/lib/src/rendering/layer.dart
View file @
78db9656
...
...
@@ -672,9 +672,9 @@ class PlatformViewLayer extends Layer {
if
(
hoverAnnotation
==
null
||
!
rect
.
contains
(
localPosition
))
{
return
false
;
}
if
(
MouseTrackerAnnotation
==
S
)
{
if
(
S
==
MouseTrackerAnnotation
)
{
final
Object
untypedValue
=
hoverAnnotation
;
final
S
typedValue
=
untypedValue
;
final
S
typedValue
=
untypedValue
as
S
;
result
.
add
(
AnnotationEntry
<
S
>(
annotation:
typedValue
,
localPosition:
localPosition
,
...
...
packages/flutter/lib/src/rendering/proxy_sliver.dart
View file @
78db9656
...
...
@@ -7,6 +7,7 @@ import 'dart:ui' as ui show Color;
import
'package:flutter/foundation.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
import
'layer.dart'
;
import
'object.dart'
;
import
'sliver.dart'
;
...
...
@@ -71,7 +72,7 @@ abstract class RenderProxySliver extends RenderSliver with RenderObjectWithChild
@override
void
applyPaintTransform
(
RenderObject
child
,
Matrix4
transform
)
{
assert
(
child
!=
null
);
final
SliverPhysicalParentData
childParentData
=
child
.
parentData
;
final
SliverPhysicalParentData
childParentData
=
child
.
parentData
as
SliverPhysicalParentData
;
childParentData
.
applyPaintTransform
(
transform
);
}
}
...
...
@@ -169,7 +170,7 @@ class RenderSliverOpacity extends RenderProxySliver {
offset
,
_alpha
,
_paintWithOpacity
,
oldLayer:
layer
,
oldLayer:
layer
as
OpacityLayer
,
);
}
}
...
...
packages/flutter/lib/src/widgets/binding.dart
View file @
78db9656
...
...
@@ -332,7 +332,7 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
registerServiceExtension
(
name:
'fastReassemble'
,
callback:
(
Map
<
String
,
Object
>
params
)
async
{
final
String
className
=
params
[
'class'
];
final
String
className
=
params
[
'class'
]
as
String
;
void
markElementsDirty
(
Element
element
)
{
if
(
element
==
null
)
{
return
;
...
...
packages/flutter/lib/src/widgets/drag_target.dart
View file @
78db9656
...
...
@@ -48,7 +48,7 @@ typedef DragEndCallback = void Function(DraggableDetails details);
/// Signature for when a [Draggable] leaves a [DragTarget].
///
/// Used by [DragTarget.onLeave].
typedef
DragTargetLeave
<
T
>
=
void
Function
(
T
data
);
typedef
DragTargetLeave
=
void
Function
(
Object
data
);
/// Where the [Draggable] should be anchored during a drag.
enum
DragAnchor
{
...
...
@@ -502,7 +502,7 @@ class DragTarget<T> extends StatefulWidget {
/// Called when a given piece of data being dragged over this target leaves
/// the target.
final
DragTargetLeave
<
T
>
onLeave
;
final
DragTargetLeave
onLeave
;
@override
_DragTargetState
<
T
>
createState
()
=>
_DragTargetState
<
T
>();
...
...
@@ -514,13 +514,12 @@ List<T> _mapAvatarsToData<T>(List<_DragAvatar<T>> avatars) {
class
_DragTargetState
<
T
>
extends
State
<
DragTarget
<
T
>>
{
final
List
<
_DragAvatar
<
T
>>
_candidateAvatars
=
<
_DragAvatar
<
T
>>[];
final
List
<
_DragAvatar
<
dynamic
>>
_rejectedAvatars
=
<
_DragAvatar
<
dynamic
>>[];
final
List
<
_DragAvatar
<
Object
>>
_rejectedAvatars
=
<
_DragAvatar
<
Object
>>[];
bool
didEnter
(
_DragAvatar
<
dynamic
>
avatar
)
{
bool
didEnter
(
_DragAvatar
<
Object
>
avatar
)
{
assert
(!
_candidateAvatars
.
contains
(
avatar
));
assert
(!
_rejectedAvatars
.
contains
(
avatar
));
final
dynamic
data
=
avatar
.
data
;
if
(
data
is
T
&&
(
widget
.
onWillAccept
==
null
||
widget
.
onWillAccept
(
data
)))
{
if
(
avatar
is
_DragAvatar
<
T
>
&&
(
widget
.
onWillAccept
==
null
||
widget
.
onWillAccept
(
avatar
.
data
)))
{
setState
(()
{
_candidateAvatars
.
add
(
avatar
);
});
...
...
@@ -533,7 +532,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
}
}
void
didLeave
(
_DragAvatar
<
dynamic
>
avatar
)
{
void
didLeave
(
_DragAvatar
<
Object
>
avatar
)
{
assert
(
_candidateAvatars
.
contains
(
avatar
)
||
_rejectedAvatars
.
contains
(
avatar
));
if
(!
mounted
)
return
;
...
...
@@ -545,7 +544,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
widget
.
onLeave
(
avatar
.
data
);
}
void
didDrop
(
_DragAvatar
<
dynamic
>
avatar
)
{
void
didDrop
(
_DragAvatar
<
Object
>
avatar
)
{
assert
(
_candidateAvatars
.
contains
(
avatar
));
if
(!
mounted
)
return
;
...
...
@@ -553,7 +552,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
_candidateAvatars
.
remove
(
avatar
);
});
if
(
widget
.
onAccept
!=
null
)
widget
.
onAccept
(
avatar
.
data
);
widget
.
onAccept
(
avatar
.
data
as
T
);
}
@override
...
...
@@ -562,7 +561,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
return
MetaData
(
metaData:
this
,
behavior:
HitTestBehavior
.
translucent
,
child:
widget
.
builder
(
context
,
_mapAvatarsToData
<
T
>(
_candidateAvatars
),
_mapAvatarsToData
<
dynamic
>(
_rejectedAvatars
)),
child:
widget
.
builder
(
context
,
_mapAvatarsToData
<
T
>(
_candidateAvatars
),
_mapAvatarsToData
<
Object
>(
_rejectedAvatars
)),
);
}
}
...
...
packages/flutter/test/widgets/draggable_test.dart
View file @
78db9656
...
...
@@ -90,13 +90,21 @@ void main() {
builder:
(
BuildContext
context
,
List
<
int
>
data
,
List
<
dynamic
>
rejects
)
{
return
Container
(
height:
100.0
,
child:
const
Text
(
'Target 1'
));
},
onLeave:
(
int
data
)
=>
leftBehind
[
'Target 1'
]
=
leftBehind
[
'Target 1'
]
+
data
,
onLeave:
(
Object
data
)
{
if
(
data
is
int
)
{
leftBehind
[
'Target 1'
]
=
leftBehind
[
'Target 1'
]
+
data
;
}
},
),
DragTarget
<
int
>(
builder:
(
BuildContext
context
,
List
<
int
>
data
,
List
<
dynamic
>
rejects
)
{
return
Container
(
height:
100.0
,
child:
const
Text
(
'Target 2'
));
},
onLeave:
(
int
data
)
=>
leftBehind
[
'Target 2'
]
=
leftBehind
[
'Target 2'
]
+
data
,
onLeave:
(
Object
data
)
{
if
(
data
is
int
)
{
leftBehind
[
'Target 2'
]
=
leftBehind
[
'Target 2'
]
+
data
;
}
},
),
],
),
...
...
packages/flutter_driver/analysis_options.yaml
deleted
100644 → 0
View file @
4af66e33
# Override the parent analysis_options until all the repo has implicit-casts: false
include
:
../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
packages/flutter_goldens/analysis_options.yaml
View file @
78db9656
...
...
@@ -2,8 +2,3 @@
# the ones from above, which include the `public_member_api_docs` rule).
include
:
../../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
packages/flutter_goldens_client/analysis_options.yaml
View file @
78db9656
...
...
@@ -2,8 +2,3 @@
# the ones from above, which include the `public_member_api_docs` rule).
include
:
../../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
packages/flutter_localizations/analysis_options.yaml
deleted
100644 → 0
View file @
4af66e33
# Override the parent analysis_options until all the repo has implicit-casts: false
include
:
../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
linter
:
rules
:
avoid_as
:
false
packages/flutter_test/analysis_options.yaml
deleted
100644 → 0
View file @
4af66e33
include
:
../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
packages/flutter_tools/analysis_options.yaml
View file @
78db9656
...
...
@@ -3,11 +3,6 @@
include
:
../../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
linter
:
rules
:
unawaited_futures
:
true
...
...
packages/flutter_web_plugins/analysis_options.yaml
deleted
100644 → 0
View file @
4af66e33
# Override the parent analysis_options until all the repo has implicit-casts: false
include
:
../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
packages/fuchsia_remote_debug_protocol/analysis_options.yaml
deleted
100644 → 0
View file @
4af66e33
# Override the parent analysis_options until all the repo has implicit-casts: false
include
:
../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
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