mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
dev: Use a super-parameter in several missed cases
This commit is contained in:
parent
a1b62d3566
commit
2ee8f3cdca
@ -8,7 +8,7 @@ import 'perf_tests.dart';
|
||||
class NewGalleryPerfTest extends PerfTest {
|
||||
NewGalleryPerfTest({
|
||||
String timelineFileName = 'transitions',
|
||||
String dartDefine = '',
|
||||
super.dartDefine = '',
|
||||
super.enableImpeller,
|
||||
super.timeoutSeconds,
|
||||
super.forceOpenGLES,
|
||||
@ -16,7 +16,6 @@ class NewGalleryPerfTest extends PerfTest {
|
||||
'${flutterDirectory.path}/dev/integration_tests/new_gallery',
|
||||
'test_driver/transitions_perf.dart',
|
||||
timelineFileName,
|
||||
dartDefine: dartDefine,
|
||||
createPlatforms: <String>['android', 'ios', 'web'],
|
||||
enableMergedPlatformThread: true,
|
||||
);
|
||||
|
||||
@ -18,8 +18,8 @@ MethodChannel channel = const MethodChannel('android_views_integration');
|
||||
const String kEventsFileName = 'touchEvents';
|
||||
|
||||
class MotionEventsPage extends PageWidget {
|
||||
const MotionEventsPage({Key? key})
|
||||
: super('Motion Event Tests', const ValueKey<String>('MotionEventsListTile'), key: key);
|
||||
const MotionEventsPage({super.key})
|
||||
: super('Motion Event Tests', const ValueKey<String>('MotionEventsListTile'));
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -135,10 +135,11 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
|
||||
'packages/assets_for_android_views/assets/touchEvents',
|
||||
);
|
||||
final unTypedRecordedEvents = codec.decodeMessage(data) as List<dynamic>;
|
||||
final List<Map<String, dynamic>> recordedEvents = unTypedRecordedEvents
|
||||
.cast<Map<dynamic, dynamic>>()
|
||||
.map<Map<String, dynamic>>((Map<dynamic, dynamic> e) => e.cast<String, dynamic>())
|
||||
.toList();
|
||||
final List<Map<String, dynamic>> recordedEvents =
|
||||
unTypedRecordedEvents
|
||||
.cast<Map<dynamic, dynamic>>()
|
||||
.map<Map<String, dynamic>>((Map<dynamic, dynamic> e) => e.cast<String, dynamic>())
|
||||
.toList();
|
||||
await channel.invokeMethod<void>('pipeFlutterViewEvents');
|
||||
await viewChannel?.invokeMethod<void>('pipeTouchEvents');
|
||||
print('replaying ${recordedEvents.length} motion events');
|
||||
@ -305,8 +306,8 @@ class TouchEventDiff extends StatelessWidget {
|
||||
buffer.write('pointer: ${getPointerIdx(action)} ');
|
||||
}
|
||||
|
||||
final List<Map<dynamic, dynamic>> coords = (event['pointerCoords'] as List<dynamic>)
|
||||
.cast<Map<dynamic, dynamic>>();
|
||||
final List<Map<dynamic, dynamic>> coords =
|
||||
(event['pointerCoords'] as List<dynamic>).cast<Map<dynamic, dynamic>>();
|
||||
for (var i = 0; i < coords.length; i++) {
|
||||
buffer.write(
|
||||
'p$i x: ${coords[i]['x']} y: ${coords[i]['y']}, pressure: ${coords[i]['pressure']} ',
|
||||
|
||||
@ -10,12 +10,8 @@ import 'package:flutter/services.dart';
|
||||
import 'page.dart';
|
||||
|
||||
class WindowManagerIntegrationsPage extends PageWidget {
|
||||
const WindowManagerIntegrationsPage({Key? key})
|
||||
: super(
|
||||
'Window Manager Integrations Tests',
|
||||
const ValueKey<String>('WmIntegrationsListTile'),
|
||||
key: key,
|
||||
);
|
||||
const WindowManagerIntegrationsPage({super.key})
|
||||
: super('Window Manager Integrations Tests', const ValueKey<String>('WmIntegrationsListTile'));
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => const WindowManagerBody();
|
||||
|
||||
@ -214,9 +214,7 @@ class KeyRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: keys),
|
||||
);
|
||||
return Expanded(child: Row(mainAxisAlignment: MainAxisAlignment.center, children: keys));
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,8 +246,8 @@ class CalcKey extends StatelessWidget {
|
||||
}
|
||||
|
||||
class NumberKey extends CalcKey {
|
||||
NumberKey(int value, CalculatorState? calcState, {Key? key})
|
||||
NumberKey(int value, CalculatorState? calcState, {super.key})
|
||||
: super('$value', () {
|
||||
calcState!.handleNumberTap(value);
|
||||
}, key: key);
|
||||
});
|
||||
}
|
||||
|
||||
@ -17,8 +17,8 @@ import 'page.dart';
|
||||
const String kEventsFileName = 'touchEvents';
|
||||
|
||||
class MotionEventsPage extends PageWidget {
|
||||
const MotionEventsPage({Key? key})
|
||||
: super('Motion Event Tests', const ValueKey<String>('MotionEventsListTile'), key: key);
|
||||
const MotionEventsPage({super.key})
|
||||
: super('Motion Event Tests', const ValueKey<String>('MotionEventsListTile'));
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@ -12,8 +12,8 @@ import 'future_data_handler.dart';
|
||||
import 'page.dart';
|
||||
|
||||
class NestedViewEventPage extends PageWidget {
|
||||
const NestedViewEventPage({Key? key})
|
||||
: super('Nested View Event Tests', const ValueKey<String>('NestedViewEventTile'), key: key);
|
||||
const NestedViewEventPage({super.key})
|
||||
: super('Nested View Event Tests', const ValueKey<String>('NestedViewEventTile'));
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => const NestedViewEventBody();
|
||||
|
||||
@ -157,18 +157,17 @@ abstract class CodeSample {
|
||||
/// Snippets are code that is not meant to be run as a complete application, but
|
||||
/// rather as a code usage example.
|
||||
class SnippetSample extends CodeSample {
|
||||
SnippetSample(List<SourceLine> input, {required int index, required SourceLine lineProto})
|
||||
SnippetSample(List<SourceLine> input, {required super.index, required super.lineProto})
|
||||
: assumptions = <SourceLine>[],
|
||||
super(<String>['snippet'], input, index: index, lineProto: lineProto);
|
||||
super(<String>['snippet'], input);
|
||||
|
||||
factory SnippetSample.combine(
|
||||
List<SnippetSample> sections, {
|
||||
required int index,
|
||||
required SourceLine lineProto,
|
||||
}) {
|
||||
final List<SourceLine> code = sections
|
||||
.expand((SnippetSample section) => section.input)
|
||||
.toList();
|
||||
final List<SourceLine> code =
|
||||
sections.expand((SnippetSample section) => section.input).toList();
|
||||
return SnippetSample(code, index: index, lineProto: lineProto);
|
||||
}
|
||||
|
||||
@ -445,9 +444,10 @@ class SourceElement {
|
||||
int get dartpadSampleCount => samples.whereType<DartpadSample>().length;
|
||||
|
||||
/// The number of [ApplicationSample]s in the dartdoc comment for this element.
|
||||
int get applicationSampleCount => samples.where((CodeSample sample) {
|
||||
return sample is ApplicationSample && sample is! DartpadSample;
|
||||
}).length;
|
||||
int get applicationSampleCount =>
|
||||
samples.where((CodeSample sample) {
|
||||
return sample is ApplicationSample && sample is! DartpadSample;
|
||||
}).length;
|
||||
|
||||
/// The number of [SnippetSample]s in the dartdoc comment for this element.
|
||||
int get snippetCount => samples.whereType<SnippetSample>().length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user