Commit c2eb7349 authored by Adam Barth's avatar Adam Barth Committed by GitHub

Formally deprecate VirtualViewport (#8136)

This mechanism has been replaced by slivers.
parent 76964621
...@@ -164,6 +164,7 @@ class ScrollableList extends StatelessWidget { ...@@ -164,6 +164,7 @@ class ScrollableList extends StatelessWidget {
} }
} }
@deprecated
class _VirtualListViewport extends VirtualViewport { class _VirtualListViewport extends VirtualViewport {
_VirtualListViewport( _VirtualListViewport(
this.onExtentsChanged, this.onExtentsChanged,
...@@ -259,6 +260,7 @@ class _VirtualListViewport extends VirtualViewport { ...@@ -259,6 +260,7 @@ class _VirtualListViewport extends VirtualViewport {
_VirtualListViewportElement createElement() => new _VirtualListViewportElement(this); _VirtualListViewportElement createElement() => new _VirtualListViewportElement(this);
} }
@deprecated
class _VirtualListViewportElement extends VirtualViewportElement { class _VirtualListViewportElement extends VirtualViewportElement {
_VirtualListViewportElement(VirtualViewport widget) : super(widget); _VirtualListViewportElement(VirtualViewport widget) : super(widget);
......
...@@ -24,9 +24,11 @@ import 'framework.dart'; ...@@ -24,9 +24,11 @@ import 'framework.dart';
/// the viewport). /// the viewport).
/// ///
/// Used by [ScrollableList.onExtentsChanged], etc. /// Used by [ScrollableList.onExtentsChanged], etc.
@deprecated
typedef void ExtentsChangedCallback(double contentExtent, double containerExtent); typedef void ExtentsChangedCallback(double contentExtent, double containerExtent);
/// An abstract widget whose children are not all materialized. /// An abstract widget whose children are not all materialized.
@deprecated
abstract class VirtualViewport extends RenderObjectWidget { abstract class VirtualViewport extends RenderObjectWidget {
/// The offset from the [ViewportAnchor] at which the viewport should start painting children. /// The offset from the [ViewportAnchor] at which the viewport should start painting children.
double get startOffset; double get startOffset;
...@@ -34,6 +36,7 @@ abstract class VirtualViewport extends RenderObjectWidget { ...@@ -34,6 +36,7 @@ abstract class VirtualViewport extends RenderObjectWidget {
_WidgetProvider _createWidgetProvider(); _WidgetProvider _createWidgetProvider();
} }
@deprecated
abstract class _WidgetProvider { abstract class _WidgetProvider {
void didUpdateWidget(@checked VirtualViewport oldWidget, @checked VirtualViewport newWidget); void didUpdateWidget(@checked VirtualViewport oldWidget, @checked VirtualViewport newWidget);
int get virtualChildCount; int get virtualChildCount;
...@@ -46,6 +49,7 @@ abstract class _WidgetProvider { ...@@ -46,6 +49,7 @@ abstract class _WidgetProvider {
/// This class is a building block for building a widget that has more children /// This class is a building block for building a widget that has more children
/// than it wishes to display at any given time. For example, [ScrollableList] /// than it wishes to display at any given time. For example, [ScrollableList]
/// uses this element to materialize only those children that are visible. /// uses this element to materialize only those children that are visible.
@deprecated
abstract class VirtualViewportElement extends RenderObjectElement { abstract class VirtualViewportElement extends RenderObjectElement {
/// Creates an element that materializes a contiguous subset of its children. /// Creates an element that materializes a contiguous subset of its children.
/// ///
...@@ -235,6 +239,7 @@ abstract class VirtualViewportElement extends RenderObjectElement { ...@@ -235,6 +239,7 @@ abstract class VirtualViewportElement extends RenderObjectElement {
/// ///
/// The iterator is advanced just far enough to obtain widgets for the children /// The iterator is advanced just far enough to obtain widgets for the children
/// that need to be materialized. /// that need to be materialized.
@deprecated
abstract class VirtualViewportFromIterable extends VirtualViewport { abstract class VirtualViewportFromIterable extends VirtualViewport {
/// The children, some of which might be materialized. /// The children, some of which might be materialized.
Iterable<Widget> get children; Iterable<Widget> get children;
...@@ -243,6 +248,7 @@ abstract class VirtualViewportFromIterable extends VirtualViewport { ...@@ -243,6 +248,7 @@ abstract class VirtualViewportFromIterable extends VirtualViewport {
_IterableWidgetProvider _createWidgetProvider() => new _IterableWidgetProvider(); _IterableWidgetProvider _createWidgetProvider() => new _IterableWidgetProvider();
} }
@deprecated
class _IterableWidgetProvider extends _WidgetProvider { class _IterableWidgetProvider extends _WidgetProvider {
int _length; int _length;
Iterator<Widget> _iterator; Iterator<Widget> _iterator;
...@@ -287,12 +293,14 @@ class _IterableWidgetProvider extends _WidgetProvider { ...@@ -287,12 +293,14 @@ class _IterableWidgetProvider extends _WidgetProvider {
/// Signature of a callback that returns the sublist of widgets in the given range. /// Signature of a callback that returns the sublist of widgets in the given range.
/// ///
/// Used by [ScrollableLazyList.itemBuilder], etc. /// Used by [ScrollableLazyList.itemBuilder], etc.
@deprecated
typedef List<Widget> ItemListBuilder(BuildContext context, int start, int count); typedef List<Widget> ItemListBuilder(BuildContext context, int start, int count);
/// A VirtualViewport that represents its children using [ItemListBuilder]. /// A VirtualViewport that represents its children using [ItemListBuilder].
/// ///
/// This widget is less ergonomic than [VirtualViewportFromIterable] but scales to /// This widget is less ergonomic than [VirtualViewportFromIterable] but scales to
/// unlimited numbers of children. /// unlimited numbers of children.
@deprecated
abstract class VirtualViewportFromBuilder extends VirtualViewport { abstract class VirtualViewportFromBuilder extends VirtualViewport {
/// The total number of children that can be built. /// The total number of children that can be built.
int get itemCount; int get itemCount;
...@@ -307,6 +315,7 @@ abstract class VirtualViewportFromBuilder extends VirtualViewport { ...@@ -307,6 +315,7 @@ abstract class VirtualViewportFromBuilder extends VirtualViewport {
_LazyWidgetProvider _createWidgetProvider() => new _LazyWidgetProvider(); _LazyWidgetProvider _createWidgetProvider() => new _LazyWidgetProvider();
} }
@deprecated
class _LazyWidgetProvider extends _WidgetProvider { class _LazyWidgetProvider extends _WidgetProvider {
int _length; int _length;
int _base; int _base;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment