mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Added a ScrollListener listener to Scrollable. The ScrollListener runs each time the Scrollable's scrollOffset changes. This can be used to keep overlay widgets in sync with a Scrollable below them. Removed the Scrollable ScrollClient API. It was no longer used and was clumsy to use as a ScrollListener. Added global function findScrollableAncestor() to scrollable.dart. Added examples/widgets/overlay_geometry.dart. The app's Scaffold is contained by a Stack. The Stack is used to display green overlay "Markers" at the corners of the most recently selected list item and where the corresponding tap occurred. The app uses widget.localToGlobal() to compute the global overlay positions of the markers. The ScrollListener is used to keep the markers' positions up to date.
19 lines
576 B
Dart
19 lines
576 B
Dart
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'dart:async';
|
|
|
|
import 'package:sky/widgets/framework.dart';
|
|
|
|
import '../../../examples/widgets/overlay_geometry.dart';
|
|
import '../resources/display_list.dart';
|
|
|
|
main() async {
|
|
TestRenderView testRenderView = new TestRenderView();
|
|
OverlayGeometryApp app = new OverlayGeometryApp();
|
|
runApp(app, renderViewOverride: testRenderView);
|
|
await testRenderView.checkFrame();
|
|
testRenderView.endTest();
|
|
}
|