Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the `engine` subdirectory and enforces that these files stay formatted with a presubmit check. **Reviewers:** Please carefully review all the commits except for the one titled "formatted". The "formatted" commit was auto-generated by running `dev/tools/format.sh -a -f`. The other commits were hand-crafted to prepare the repo for the formatting change. I recommend reviewing the commits one-by-one via the "Commits" tab and avoiding Github's "Files changed" tab as it will likely slow down your browser because of the size of this PR. --------- Co-authored-by: Kate Lovett <katelovett@google.com> Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8e0993eda8
commit
5491c8c146
@@ -14,29 +14,31 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
Future<void> main() async {
|
||||
const int numItems = 10;
|
||||
|
||||
runApp(Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: ListView.builder(
|
||||
key: const Key('ImageList'),
|
||||
itemCount: numItems,
|
||||
itemBuilder: (BuildContext context, int position) {
|
||||
return SizedBox(
|
||||
width: 200,
|
||||
height: 200,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
'monochrome/red-square-1024x1024.png',
|
||||
package: 'flutter_gallery_assets',
|
||||
width: 100,
|
||||
height: 100,
|
||||
fit: BoxFit.contain,
|
||||
key: Key('image_$position'),
|
||||
runApp(
|
||||
Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: ListView.builder(
|
||||
key: const Key('ImageList'),
|
||||
itemCount: numItems,
|
||||
itemBuilder: (BuildContext context, int position) {
|
||||
return SizedBox(
|
||||
width: 200,
|
||||
height: 200,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
'monochrome/red-square-1024x1024.png',
|
||||
package: 'flutter_gallery_assets',
|
||||
width: 100,
|
||||
height: 100,
|
||||
fit: BoxFit.contain,
|
||||
key: Key('image_$position'),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
));
|
||||
);
|
||||
|
||||
await SchedulerBinding.instance.endOfFrame;
|
||||
|
||||
@@ -47,8 +49,7 @@ Future<void> main() async {
|
||||
await Future<void>.delayed(const Duration(milliseconds: 50));
|
||||
debugPrint('==== MEMORY BENCHMARK ==== READY ====');
|
||||
|
||||
final WidgetController controller =
|
||||
LiveWidgetController(WidgetsBinding.instance);
|
||||
final WidgetController controller = LiveWidgetController(WidgetsBinding.instance);
|
||||
|
||||
debugPrint('Scrolling...');
|
||||
final Finder list = find.byKey(const Key('ImageList'));
|
||||
|
||||
@@ -24,16 +24,16 @@ Rect boundsFor(WidgetController controller, Finder item) {
|
||||
|
||||
Future<void> main() async {
|
||||
final Completer<void> ready = Completer<void>();
|
||||
runApp(GestureDetector(
|
||||
onTap: () {
|
||||
debugPrint('==== MEMORY BENCHMARK ==== TAPPED ====');
|
||||
ready.complete();
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: const IgnorePointer(
|
||||
child: GalleryApp(testMode: true),
|
||||
runApp(
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
debugPrint('==== MEMORY BENCHMARK ==== TAPPED ====');
|
||||
ready.complete();
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: const IgnorePointer(child: GalleryApp(testMode: true)),
|
||||
),
|
||||
));
|
||||
);
|
||||
await SchedulerBinding.instance.endOfFrame;
|
||||
debugPrint('==== MEMORY BENCHMARK ==== READY ====');
|
||||
|
||||
@@ -44,12 +44,9 @@ Future<void> main() async {
|
||||
await Future<void>.delayed(const Duration(milliseconds: 200));
|
||||
|
||||
// remove onTap handler, enable pointer events for app
|
||||
runApp(GestureDetector(
|
||||
child: const IgnorePointer(
|
||||
ignoring: false,
|
||||
child: GalleryApp(testMode: true),
|
||||
),
|
||||
));
|
||||
runApp(
|
||||
GestureDetector(child: const IgnorePointer(ignoring: false, child: GalleryApp(testMode: true))),
|
||||
);
|
||||
await SchedulerBinding.instance.endOfFrame;
|
||||
|
||||
final WidgetController controller = LiveWidgetController(WidgetsBinding.instance);
|
||||
@@ -69,7 +66,10 @@ Future<void> main() async {
|
||||
final Rect demoItemBounds = boundsFor(controller, demoItem);
|
||||
final Rect demoListBounds = boundsFor(controller, demoList);
|
||||
if (!demoListBounds.contains(demoItemBounds.center)) {
|
||||
await controller.drag(demoList, Offset(0.0, demoListBounds.center.dy - demoItemBounds.center.dy));
|
||||
await controller.drag(
|
||||
demoList,
|
||||
Offset(0.0, demoListBounds.center.dy - demoItemBounds.center.dy),
|
||||
);
|
||||
await endOfAnimation();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user