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