widgets.dart.expect 8.7 KB
Newer Older
1 2 3 4 5 6 7
// Copyright 2014 The Flutter 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 'package:flutter/widgets.dart';

void main() {
8 9
  // Generic reference variables.
  BuildContext context;
10 11 12
  RenderObjectWidget renderObjectWidget;
  RenderObject renderObject;
  Object object;
13

14 15 16 17 18 19 20 21 22 23
  // Changes made in https://github.com/flutter/flutter/pull/44189
  const Element element = Element(myWidget);
  element.dependOnInheritedElement(ancestor);
  element.dependOnInheritedWidgetOfExactType<targetType>();
  element.getElementForInheritedWidgetOfExactType<targetType>();
  element.findAncestorWidgetOfExactType<targetType>();
  element.findAncestorStateOfType<targetType>();
  element.findRootAncestorStateOfType<targetType>();
  element.findAncestorRenderObjectOfType<targetType>();

24 25
  // Changes made in https://github.com/flutter/flutter/pull/45941 and https://github.com/flutter/flutter/pull/83843
  final WidgetsBinding binding = WidgetsBinding.instance;
26 27 28
  binding.deferFirstFrame();
  binding.allowFirstFrame();

29 30 31
  // Changes made in https://github.com/flutter/flutter/pull/44189
  const StatefulElement statefulElement = StatefulElement(myWidget);
  statefulElement.dependOnInheritedElement(ancestor);
32 33 34 35 36 37 38 39 40 41

  // Changes made in https://github.com/flutter/flutter/pull/44189
  const BuildContext buildContext = Element(myWidget);
  buildContext.dependOnInheritedElement(ancestor);
  buildContext.dependOnInheritedWidgetOfExactType<targetType>();
  buildContext.getElementForInheritedWidgetOfExactType<targetType>();
  buildContext.findAncestorWidgetOfExactType<targetType>();
  buildContext.findAncestorStateOfType<targetType>();
  buildContext.findRootAncestorStateOfType<targetType>();
  buildContext.findAncestorRenderObjectOfType<targetType>();
42

43
  // Changes made in https://github.com/flutter/flutter/pull/61648
44 45
  const Form form = Form(autovalidateMode: AutovalidateMode.always);
  const Form form = Form(autovalidateMode: AutovalidateMode.disabled);
46
  const Form form = Form(error: '');
47 48 49
  final autoMode = form.autovalidateMode;

  // Changes made in https://github.com/flutter/flutter/pull/61648
50 51
  const FormField formField = FormField(autovalidateMode: AutovalidateMode.always);
  const FormField formField = FormField(autovalidateMode: AutovalidateMode.disabled);
52
  const FormField formField = FormField(error: '');
53 54
  final autoMode = formField.autovalidateMode;

55 56 57
  // Changes made in https://github.com/flutter/flutter/pull/66305
  const Stack stack = Stack(clipBehavior: Clip.none);
  const Stack stack = Stack(clipBehavior: Clip.hardEdge);
58
  const Stack stack = Stack(error: '');
59
  final behavior = stack.clipBehavior;
60 61 62 63

  // Changes made in https://github.com/flutter/flutter/pull/68736
  MediaQuery.maybeOf(context);
  MediaQuery.of(context);
64
  MediaQuery.of(error: '');
65 66 67 68

  // Changes made in https://github.com/flutter/flutter/pull/70726
  Navigator.maybeOf(context);
  Navigator.of(context);
69
  Navigator.of(error: '');
70 71 72 73

  // Changes made in https://github.com/flutter/flutter/pull/68910
  Router.maybeOf(context);
  Router.of(context);
74
  Router.of(error: '');
75 76 77 78

  // Changes made in https://github.com/flutter/flutter/pull/68911
  Localizations.maybeLocaleOf(context);
  Localizations.localeOf(context);
79
  Localizations.localeOf(error: '');
80 81 82 83

  // Changes made in https://github.com/flutter/flutter/pull/68917
  FocusTraversalOrder.maybeOf(context);
  FocusTraversalOrder.of(context);
84 85
  FocusTraversalOrder.of(error: '');
  FocusTraversalGroup.of(error: '');
86 87 88 89
  FocusTraversalGroup.maybeOf(context);
  FocusTraversalGroup.of(context);
  Focus.maybeOf(context);
  Focus.of(context);
90
  Focus.of(error: '');
91 92 93 94

  // Changes made in https://github.com/flutter/flutter/pull/68921
  Shortcuts.maybeOf(context);
  Shortcuts.of(context);
95 96
  Shortcuts.of(error: '');
  Actions.find(error: '');
97 98 99 100
  Actions.maybeFind(context);
  Actions.find(context);
  Actions.handler(context);
  Actions.handler(context);
101 102
  Actions.handler(error: '');
  Actions.invoke(error: '');
103 104 105 106 107 108
  Actions.maybeInvoke(context);
  Actions.invoke(context);

  // Changes made in https://github.com/flutter/flutter/pull/68925
  AnimatedList.maybeOf(context);
  AnimatedList.of(context);
109 110
  AnimatedList.of(error: '');
  SliverAnimatedList.of(error: '');
111 112
  SliverAnimatedList.maybeOf(context);
  SliverAnimatedList.of(context);
113 114 115

  // Changes made in https://github.com/flutter/flutter/pull/59127
  const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(label: myTitle);
116 117
  const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem();
  const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(error: '');
118
  bottomNavigationBarItem.label;
119 120 121 122 123

  // Changes made in https://github.com/flutter/flutter/pull/79160
  Draggable draggable = Draggable();
  draggable = Draggable(dragAnchorStrategy: childDragAnchorStrategy);
  draggable = Draggable(dragAnchorStrategy: pointerDragAnchorStrategy);
124
  draggable = Draggable(error: '');
125 126 127 128 129 130
  draggable.dragAnchorStrategy;

  // Changes made in https://github.com/flutter/flutter/pull/79160
  LongPressDraggable longPressDraggable = LongPressDraggable();
  longPressDraggable = LongPressDraggable(dragAnchorStrategy: childDragAnchorStrategy);
  longPressDraggable = LongPressDraggable(dragAnchorStrategy: pointerDragAnchorStrategy);
131
  longPressDraggable = LongPressDraggable(error: '');
132
  longPressDraggable.dragAnchorStrategy;
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158

  // Changes made in https://github.com/flutter/flutter/pull/64254
  final LeafRenderObjectElement leafElement = LeafRenderObjectElement();
  leafElement.insertRenderObjectChild(renderObject, object);
  leafElement.moveRenderObjectChild(renderObject, object);
  leafElement.removeRenderObjectChild(renderObject);
  final ListWheelElement listWheelElement = ListWheelElement();
  listWheelElement.insertRenderObjectChild(renderObject, object);
  listWheelElement.moveRenderObjectChild(renderObject, object);
  listWheelElement.removeRenderObjectChild(renderObject);
  final MultiChildRenderObjectElement multiChildRenderObjectElement = MultiChildRenderObjectElement();
  multiChildRenderObjectElement.insertRenderObjectChild(renderObject, object);
  multiChildRenderObjectElement.moveRenderObjectChild(renderObject, object);
  multiChildRenderObjectElement.removeRenderObjectChild(renderObject);
  final SingleChildRenderObjectElement singleChildRenderObjectElement = SingleChildRenderObjectElement();
  singleChildRenderObjectElement.insertRenderObjectChild(renderObject, object);
  singleChildRenderObjectElement.moveRenderObjectChild(renderObject, object);
  singleChildRenderObjectElement.removeRenderObjectChild(renderObject);
  final SliverMultiBoxAdaptorElement sliverMultiBoxAdaptorElement = SliverMultiBoxAdaptorElement();
  sliverMultiBoxAdaptorElement.insertRenderObjectChild(renderObject, object);
  sliverMultiBoxAdaptorElement.moveRenderObjectChild(renderObject, object);
  sliverMultiBoxAdaptorElement.removeRenderObjectChild(renderObject);
  final RenderObjectToWidgetElement renderObjectToWidgetElement = RenderObjectToWidgetElement(widget);
  renderObjectToWidgetElement.insertRenderObjectChild(renderObject, object);
  renderObjectToWidgetElement.moveRenderObjectChild(renderObject, object);
  renderObjectToWidgetElement.removeRenderObjectChild(renderObject);
159 160 161 162 163

  // Changes made in https://flutter.dev/docs/release/breaking-changes/clip-behavior
  ListWheelScrollView listWheelScrollView = ListWheelScrollView();
  listWheelScrollView = ListWheelScrollView(clipBehavior: Clip.hardEdge);
  listWheelScrollView = ListWheelScrollView(clipBehavior: Clip.none);
164
  listWheelScrollView = ListWheelScrollView(error: '');
165 166 167
  listWheelScrollView = ListWheelScrollView.useDelegate();
  listWheelScrollView = ListWheelScrollView.useDelegate(clipBehavior: Clip.hardEdge);
  listWheelScrollView = ListWheelScrollView.useDelegate(clipBehavior: Clip.none);
168
  listWheelScrollView = ListWheelScrollView.useDelegate(error: '');
169 170 171 172
  listWheelScrollView.clipBehavior;
  ListWheelViewport listWheelViewport = ListWheelViewport();
  listWheelViewport = ListWheelViewport(clipBehavior: Clip.hardEdge);
  listWheelViewport = ListWheelViewport(clipBehavior: Clip.none);
173
  listWheelViewport = ListWheelViewport(error: '');
174
  listWheelViewport.clipBehavior;
175 176 177

  // Changes made in https://github.com/flutter/flutter/pull/87839
  final OverscrollIndicatorNotification notification = OverscrollIndicatorNotification(leading: true);
178
  final OverscrollIndicatorNotification notification = OverscrollIndicatorNotification(error: '');
179
  notification.disallowIndicator();
180 181 182 183

  // Changes made in https://github.com/flutter/flutter/pull/96957
  RawScrollbar rawScrollbar = RawScrollbar(thumbVisibility: true);
  nowShowing = rawScrollbar.thumbVisibility;
184 185 186

  // Change made in https://github.com/flutter/flutter/pull/100381
  SelectionOverlay.fadeDuration;
187
}