Turn on avoid_dynamic_calls lint, except packages/flutter tests, make appropriate changes. (#84476)
This adds avoid_dynamic_calls to the list of lints, and fixes all instances where it was violated. Importantly, this lint is NOT turned on for flutter/packages/test, because those changes are happening in another PR: #84478
This commit is contained in:
@@ -46,7 +46,7 @@ class _ColorPickerSwatch extends StatelessWidget {
|
||||
|
||||
final Color color;
|
||||
final bool selected;
|
||||
final Function? onTap;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
|
||||
@@ -42,7 +42,7 @@ Future<void> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
|
||||
frameStart = timestamp;
|
||||
} else {
|
||||
assert(phase == 'E');
|
||||
final String routeName = startEvent['args']['to'] as String;
|
||||
final String routeName = (startEvent['args'] as Map<String, dynamic>)['to'] as String;
|
||||
durations[routeName] ??= <int>[];
|
||||
durations[routeName]!.add(timestamp - frameStart!);
|
||||
startEvent = null;
|
||||
@@ -79,7 +79,7 @@ Future<void> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
|
||||
continue;
|
||||
|
||||
final String routeName = eventName == 'Start Transition'
|
||||
? eventIter.current['args']['to'] as String
|
||||
? (eventIter.current['args'] as Map<String, dynamic>)['to'] as String
|
||||
: '';
|
||||
|
||||
if (eventName == lastEventName && routeName == lastRouteName) {
|
||||
|
||||
Reference in New Issue
Block a user