// 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/material.dart';import'package:flutter_api_samples/widgets/scroll_position/scroll_controller_notification.0.dart'asexample;import'package:flutter_test/flutter_test.dart';voidmain(){testWidgets('Can toggle between scroll notification types',(WidgetTestertester)async{awaittester.pumpWidget(constexample.ScrollNotificationDemo(),);expect(find.byType(CustomScrollView),findsOneWidget);expect(find.text('Last notification: Null'),findsNothing);// Toggle to use NotificationListenerawaittester.tap(find.byWidgetPredicate((Widgetwidget){returnwidgetisRadio<bool>&&!widget.value;}));awaittester.pumpAndSettle();expect(find.text('Last notification: Null'),findsOneWidget);awaittester.drag(find.byType(CustomScrollView),constOffset(20.0,20.0));awaittester.pumpAndSettle();expect(find.text('Last notification: UserScrollNotification'),findsOneWidget);});}