Unverified Commit 18795b47 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Migrate some widget tests to NNBD (#67776)

parent b4e4e8d9
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
......@@ -12,15 +10,15 @@ import 'package:flutter_test/flutter_test.dart';
const double itemExtent = 100.0;
Axis scrollDirection = Axis.vertical;
DismissDirection dismissDirection = DismissDirection.horizontal;
DismissDirection reportedDismissDirection;
late DismissDirection reportedDismissDirection;
List<int> dismissedItems = <int>[];
Widget background;
Widget? background;
const double crossAxisEndOffset = 0.5;
Widget buildTest({
double startToEndThreshold,
double? startToEndThreshold,
TextDirection textDirection = TextDirection.ltr,
Future<bool> Function(BuildContext context, DismissDirection direction) confirmDismiss,
Future<bool> Function(BuildContext context, DismissDirection direction)? confirmDismiss,
}) {
return Directionality(
textDirection: textDirection,
......@@ -73,9 +71,9 @@ Widget buildTest({
);
}
typedef DismissMethod = Future<void> Function(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection });
typedef DismissMethod = Future<void> Function(WidgetTester tester, Finder finder, { required AxisDirection gestureDirection });
Future<void> dismissElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection }) async {
Future<void> dismissElement(WidgetTester tester, Finder finder, { required AxisDirection gestureDirection }) async {
Offset downLocation;
Offset upLocation;
switch (gestureDirection) {
......@@ -110,7 +108,7 @@ Future<void> dismissElement(WidgetTester tester, Finder finder, { @required Axis
await gesture.up();
}
Future<void> flingElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection, double initialOffsetFactor = 0.0 }) async {
Future<void> flingElement(WidgetTester tester, Finder finder, { required AxisDirection gestureDirection, double initialOffsetFactor = 0.0 }) async {
Offset delta;
switch (gestureDirection) {
case AxisDirection.left:
......@@ -131,7 +129,7 @@ Future<void> flingElement(WidgetTester tester, Finder finder, { @required AxisDi
await tester.fling(finder, delta, 1000.0, initialOffset: delta * initialOffsetFactor);
}
Future<void> flingElementFromZero(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection }) async {
Future<void> flingElementFromZero(WidgetTester tester, Finder finder, { required AxisDirection gestureDirection }) async {
// This is a special case where we drag in one direction, then fling back so
// that at the point of release, we're at exactly the point at which we
// started, but with velocity. This is needed to check a boundary condition
......@@ -142,7 +140,7 @@ Future<void> flingElementFromZero(WidgetTester tester, Finder finder, { @require
Future<void> dismissItem(
WidgetTester tester,
int item, {
@required AxisDirection gestureDirection,
required AxisDirection gestureDirection,
DismissMethod mechanism = dismissElement,
}) async {
assert(gestureDirection != null);
......@@ -161,7 +159,7 @@ Future<void> dismissItem(
Future<void> checkFlingItemBeforeMovementEnd(
WidgetTester tester,
int item, {
@required AxisDirection gestureDirection,
required AxisDirection gestureDirection,
DismissMethod mechanism = rollbackElement,
}) async {
assert(gestureDirection != null);
......@@ -177,7 +175,7 @@ Future<void> checkFlingItemBeforeMovementEnd(
Future<void> checkFlingItemAfterMovement(
WidgetTester tester,
int item, {
@required AxisDirection gestureDirection,
required AxisDirection gestureDirection,
DismissMethod mechanism = rollbackElement,
}) async {
assert(gestureDirection != null);
......@@ -190,7 +188,7 @@ Future<void> checkFlingItemAfterMovement(
await tester.pump(const Duration(milliseconds: 300));
}
Future<void> rollbackElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection, double initialOffsetFactor = 0.0 }) async {
Future<void> rollbackElement(WidgetTester tester, Finder finder, { required AxisDirection gestureDirection, double initialOffsetFactor = 0.0 }) async {
Offset delta;
switch (gestureDirection) {
case AxisDirection.left:
......@@ -210,7 +208,7 @@ Future<void> rollbackElement(WidgetTester tester, Finder finder, { @required Axi
}
class Test1215DismissibleWidget extends StatelessWidget {
const Test1215DismissibleWidget(this.text, { Key key }) : super(key: key);
const Test1215DismissibleWidget(this.text, { Key? key }) : super(key: key);
final String text;
......@@ -679,9 +677,9 @@ void main() {
testWidgets('confirmDismiss returns values: true, false, null', (WidgetTester tester) async {
scrollDirection = Axis.vertical;
dismissDirection = DismissDirection.horizontal;
DismissDirection confirmDismissDirection;
late DismissDirection confirmDismissDirection;
Widget buildFrame(bool confirmDismissValue) {
Widget buildFrame(bool? confirmDismissValue) {
return buildTest(
confirmDismiss: (BuildContext context, DismissDirection dismissDirection) {
confirmDismissDirection = dismissDirection;
......@@ -802,7 +800,7 @@ void main() {
testWidgets('Dismissible.behavior should behave correctly during hit testing', (WidgetTester tester) async {
bool didReceivePointerDown = false;
Widget buildStack({Widget child}) {
Widget buildStack({required Widget child}) {
return Directionality(
textDirection: TextDirection.ltr,
child: Stack(
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart';
......@@ -14,7 +12,7 @@ void main() {
final GlobalKey<TestWidgetState> key = GlobalKey<TestWidgetState>();
await tester.pumpWidget(TestWidget(key));
final TestWidgetState state = key.currentState;
final TestWidgetState state = key.currentState!;
expect(state.mounted, true);
final DisposableBuildContext context = DisposableBuildContext(state);
......@@ -35,7 +33,7 @@ void main() {
}
class TestWidget extends StatefulWidget {
const TestWidget(Key key) : super(key: key);
const TestWidget(Key? key) : super(key: key);
@override
State<TestWidget> createState() => TestWidgetState();
......
......@@ -2,15 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart';
typedef TestCallback = void Function(BuildContext context);
class TestWidget extends StatefulWidget {
const TestWidget(this.callback, { Key key }) : super(key: key);
const TestWidget(this.callback, { Key? key }) : super(key: key);
final TestCallback callback;
......
......@@ -2,22 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
Widget _boilerplate(VoidCallback onButtonPressed, {
Widget _boilerplate(VoidCallback? onButtonPressed, {
int itemCount = 100,
double initialChildSize = .5,
double maxChildSize = 1.0,
double minChildSize = .25,
double itemExtent,
Key containerKey,
NotificationListenerCallback<ScrollNotification> onScrollNotification,
double? itemExtent,
Key? containerKey,
NotificationListenerCallback<ScrollNotification>? onScrollNotification,
}) {
return Directionality(
textDirection: TextDirection.ltr,
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'dart:ui';
import 'package:flutter_test/flutter_test.dart';
......@@ -19,7 +17,7 @@ void main() {
testWidgets('Drawer control test', (WidgetTester tester) async {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
BuildContext savedContext;
late BuildContext savedContext;
await tester.pumpWidget(
MaterialApp(
home: Builder(
......@@ -36,7 +34,7 @@ void main() {
);
await tester.pump(); // no effect
expect(find.text('drawer'), findsNothing);
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(); // drawer should be starting to animate in
expect(find.text('drawer'), findsOneWidget);
await tester.pump(const Duration(seconds: 1)); // animation done
......@@ -61,7 +59,7 @@ void main() {
);
await tester.pump(); // no effect
expect(find.text('drawer'), findsNothing);
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(); // drawer should be starting to animate in
expect(find.text('drawer'), findsOneWidget);
await tester.pump(const Duration(seconds: 1)); // animation done
......@@ -120,7 +118,7 @@ void main() {
logs.clear();
// When drawer is open, hover is uninteractable
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(const Duration(seconds: 1)); // animation done
expect(find.text('drawer'), findsOneWidget);
......@@ -174,7 +172,7 @@ void main() {
),
);
expect(find.text('drawer'), findsNothing);
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(); // drawer should be starting to animate in
expect(find.text('drawer'), findsOneWidget);
await tester.pump(const Duration(seconds: 1)); // animation done
......@@ -228,7 +226,7 @@ void main() {
),
);
expect(find.text('drawer'), findsNothing);
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(); // drawer should be starting to animate in
expect(find.text('drawer'), findsOneWidget);
await tester.pump(const Duration(seconds: 1)); // animation done
......@@ -290,7 +288,7 @@ void main() {
);
// Open the drawer.
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(); // drawer should be starting to animate in
expect(find.text('drawer'), findsOneWidget);
......@@ -324,7 +322,7 @@ void main() {
);
// Open the drawer.
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(const Duration(milliseconds: 100));
expect(semantics, includesNodeWith(actions: <SemanticsAction>[SemanticsAction.tap]));
......@@ -352,7 +350,7 @@ void main() {
);
// Open the drawer.
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump(const Duration(milliseconds: 100));
expect(semantics, isNot(includesNodeWith(actions: <SemanticsAction>[SemanticsAction.tap])));
......@@ -380,7 +378,7 @@ void main() {
);
// Open the drawer.
scaffoldKey.currentState.openDrawer();
scaffoldKey.currentState!.openDrawer();
await tester.pump();
await tester.pump(const Duration(milliseconds: 100));
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
......@@ -23,7 +21,7 @@ void main() {
forwardBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return ScaleTransition(
scale: animation,
......@@ -33,7 +31,7 @@ void main() {
reverseBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return FadeTransition(
opacity: Tween<double>(begin: 1.0, end: 0.0).animate(animation),
......@@ -93,7 +91,7 @@ void main() {
forwardBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return ScaleTransition(
scale: animation,
......@@ -103,7 +101,7 @@ void main() {
reverseBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return FadeTransition(
opacity: Tween<double>(begin: 1.0, end: 0.0).animate(animation),
......@@ -155,7 +153,7 @@ void main() {
forwardBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return ScaleTransition(
scale: animation,
......@@ -165,7 +163,7 @@ void main() {
reverseBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return FadeTransition(
opacity: Tween<double>(begin: 1.0, end: 0.0).animate(animation),
......@@ -221,7 +219,7 @@ void main() {
forwardBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return ScaleTransition(
scale: animation,
......@@ -231,7 +229,7 @@ void main() {
reverseBuilder: (
BuildContext context,
Animation<double> animation,
Widget child,
Widget? child,
) {
return FadeTransition(
opacity: Tween<double>(begin: 1.0, end: 0.0).animate(animation),
......@@ -286,7 +284,7 @@ double _getOpacity(WidgetTester tester) {
}
class _StatefulTestWidget extends StatefulWidget {
const _StatefulTestWidget({Key key, this.name}) : super(key: key);
const _StatefulTestWidget({Key? key, required this.name}) : super(key: key);
final String name;
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
......@@ -46,13 +44,13 @@ void main() {
final EditableText editableText = tester.firstWidget(find.byType(EditableText));
expect(editableText.cursorWidth, 10.0);
expect(editableText.cursorHeight, 10.0);
expect(editableText.cursorRadius.x, 2.0);
expect(editableText.cursorRadius!.x, 2.0);
});
testWidgets('cursor layout has correct width', (WidgetTester tester) async {
final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>();
String changedValue;
late String changedValue;
final Widget widget = MaterialApp(
home: RepaintBoundary(
key: const ValueKey<int>(1),
......@@ -61,7 +59,7 @@ void main() {
key: editableTextKey,
controller: TextEditingController(),
focusNode: FocusNode(),
style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1,
style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!,
cursorColor: Colors.blue,
selectionControls: materialTextSelectionControls,
keyboardType: TextInputType.text,
......@@ -103,7 +101,7 @@ void main() {
testWidgets('cursor layout has correct radius', (WidgetTester tester) async {
final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>();
String changedValue;
late String changedValue;
final Widget widget = MaterialApp(
home: RepaintBoundary(
key: const ValueKey<int>(1),
......@@ -112,7 +110,7 @@ void main() {
key: editableTextKey,
controller: TextEditingController(),
focusNode: FocusNode(),
style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1,
style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!,
cursorColor: Colors.blue,
selectionControls: materialTextSelectionControls,
keyboardType: TextInputType.text,
......@@ -167,43 +165,43 @@ void main() {
final EditableTextState editableTextState = tester.firstState(find.byType(EditableText));
final RenderEditable renderEditable = editableTextState.renderEditable;
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
// Trigger initial timer. When focusing the first time, the cursor shows
// for slightly longer than the average on time.
await tester.pump();
await tester.pump(const Duration(milliseconds: 200));
// Start timing standard cursor show period.
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rrect(color: const Color(0xff2196f3)));
await tester.pump(const Duration(milliseconds: 500));
// Start to animate the cursor away.
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rrect(color: const Color(0xff2196f3)));
await tester.pump(const Duration(milliseconds: 100));
expect(renderEditable.cursorColor.alpha, 110);
expect(renderEditable.cursorColor!.alpha, 110);
expect(renderEditable, paints..rrect(color: const Color(0x6e2196f3)));
await tester.pump(const Duration(milliseconds: 100));
expect(renderEditable.cursorColor.alpha, 16);
expect(renderEditable.cursorColor!.alpha, 16);
expect(renderEditable, paints..rrect(color: const Color(0x102196f3)));
await tester.pump(const Duration(milliseconds: 100));
expect(renderEditable.cursorColor.alpha, 0);
expect(renderEditable.cursorColor!.alpha, 0);
// Don't try to draw the cursor.
expect(renderEditable, paintsExactlyCountTimes(#drawRRect, 0));
// Wait some more while the cursor is gone. It'll trigger the cursor to
// start animating in again.
await tester.pump(const Duration(milliseconds: 300));
expect(renderEditable.cursorColor.alpha, 0);
expect(renderEditable.cursorColor!.alpha, 0);
expect(renderEditable, paintsExactlyCountTimes(#drawRRect, 0));
await tester.pump(const Duration(milliseconds: 50));
// Cursor starts coming back.
expect(renderEditable.cursorColor.alpha, 79);
expect(renderEditable.cursorColor!.alpha, 79);
expect(renderEditable, paints..rrect(color: const Color(0x4f2196f3)));
}, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.macOS }));
......@@ -225,25 +223,25 @@ void main() {
final RenderEditable renderEditable = editableTextState.renderEditable;
await tester.pump();
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rect(color: defaultCursorColor));
// Android cursor goes from exactly on to exactly off on the 500ms dot.
await tester.pump(const Duration(milliseconds: 499));
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rect(color: defaultCursorColor));
await tester.pump(const Duration(milliseconds: 1));
expect(renderEditable.cursorColor.alpha, 0);
expect(renderEditable.cursorColor!.alpha, 0);
// Don't try to draw the cursor.
expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0));
await tester.pump(const Duration(milliseconds: 500));
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rect(color: defaultCursorColor));
await tester.pump(const Duration(milliseconds: 500));
expect(renderEditable.cursorColor.alpha, 0);
expect(renderEditable.cursorColor!.alpha, 0);
expect(renderEditable, paintsExactlyCountTimes(#drawRect, 0));
});
......@@ -265,21 +263,21 @@ void main() {
final EditableTextState editableTextState = tester.firstState(find.byType(EditableText));
final RenderEditable renderEditable = editableTextState.renderEditable;
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
await tester.pump();
await tester.pump(const Duration(milliseconds: 200));
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rrect(color: defaultCursorColor));
// Cursor draw never changes.
await tester.pump(const Duration(milliseconds: 200));
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rrect(color: defaultCursorColor));
// No more transient calls.
await tester.pumpAndSettle();
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rrect(color: defaultCursorColor));
EditableText.debugDeterministicCursor = false;
......@@ -304,21 +302,21 @@ void main() {
final RenderEditable renderEditable = editableTextState.renderEditable;
await tester.pump();
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rect(color: defaultCursorColor));
await tester.pump(const Duration(milliseconds: 500));
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rect(color: defaultCursorColor));
// Cursor draw never changes.
await tester.pump(const Duration(milliseconds: 500));
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rect(color: defaultCursorColor));
// No more transient calls.
await tester.pumpAndSettle();
expect(renderEditable.cursorColor.alpha, 255);
expect(renderEditable.cursorColor!.alpha, 255);
expect(renderEditable, paints..rect(color: defaultCursorColor));
EditableText.debugDeterministicCursor = false;
......@@ -716,7 +714,7 @@ void main() {
testWidgets('cursor layout', (WidgetTester tester) async {
final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>();
String changedValue;
late String changedValue;
final Widget widget = MaterialApp(
home: RepaintBoundary(
key: const ValueKey<int>(1),
......@@ -728,7 +726,7 @@ void main() {
key: editableTextKey,
controller: TextEditingController(),
focusNode: FocusNode(),
style: Typography.material2018(platform: TargetPlatform.iOS).black.subtitle1,
style: Typography.material2018(platform: TargetPlatform.iOS).black.subtitle1!,
cursorColor: Colors.blue,
selectionControls: materialTextSelectionControls,
keyboardType: TextInputType.text,
......@@ -772,7 +770,7 @@ void main() {
testWidgets('cursor layout has correct height', (WidgetTester tester) async {
final GlobalKey<EditableTextState> editableTextKey = GlobalKey<EditableTextState>();
String changedValue;
late String changedValue;
final Widget widget = MaterialApp(
home: RepaintBoundary(
key: const ValueKey<int>(1),
......@@ -784,7 +782,7 @@ void main() {
key: editableTextKey,
controller: TextEditingController(),
focusNode: FocusNode(),
style: Typography.material2018(platform: TargetPlatform.iOS).black.subtitle1,
style: Typography.material2018(platform: TargetPlatform.iOS).black.subtitle1!,
cursorColor: Colors.blue,
selectionControls: materialTextSelectionControls,
keyboardType: TextInputType.text,
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
......@@ -12,9 +10,9 @@ import 'package:flutter/services.dart';
class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate {
_TestSliverPersistentHeaderDelegate({
this.minExtent,
this.maxExtent,
this.child,
required this.minExtent,
required this.maxExtent,
required this.child,
this.vsync = const TestVSync(),
this.showOnScreenConfiguration = const PersistentHeaderShowOnScreenConfiguration(),
});
......@@ -28,7 +26,7 @@ class _TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate
final double minExtent;
@override
final TickerProvider vsync;
final TickerProvider? vsync;
@override
final PersistentHeaderShowOnScreenConfiguration showOnScreenConfiguration;
......@@ -496,13 +494,13 @@ void main() {
}
class NoImplicitScrollPhysics extends AlwaysScrollableScrollPhysics {
const NoImplicitScrollPhysics({ ScrollPhysics parent }) : super(parent: parent);
const NoImplicitScrollPhysics({ ScrollPhysics? parent }) : super(parent: parent);
@override
bool get allowImplicitScrolling => false;
@override
NoImplicitScrollPhysics applyTo(ScrollPhysics ancestor) {
NoImplicitScrollPhysics applyTo(ScrollPhysics? ancestor) {
return NoImplicitScrollPhysics(parent: buildParent(ancestor));
}
}
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