diff --git a/dev/bots/check_code_samples.dart b/dev/bots/check_code_samples.dart index 029e6322a1..8e4aab41d4 100644 --- a/dev/bots/check_code_samples.dart +++ b/dev/bots/check_code_samples.dart @@ -319,7 +319,6 @@ final Set _knownMissingTests = { 'examples/api/test/material/filled_button/filled_button.0_test.dart', 'examples/api/test/material/text_form_field/text_form_field.1_test.dart', 'examples/api/test/material/scrollbar/scrollbar.1_test.dart', - 'examples/api/test/material/scrollbar/scrollbar.0_test.dart', 'examples/api/test/material/dropdown_menu/dropdown_menu.1_test.dart', 'examples/api/test/material/radio/radio.toggleable.0_test.dart', 'examples/api/test/material/radio/radio.0_test.dart', diff --git a/examples/api/lib/material/scrollbar/scrollbar.0.dart b/examples/api/lib/material/scrollbar/scrollbar.0.dart index d8a09486b6..07f1eb4646 100644 --- a/examples/api/lib/material/scrollbar/scrollbar.0.dart +++ b/examples/api/lib/material/scrollbar/scrollbar.0.dart @@ -29,6 +29,7 @@ class ScrollbarExample extends StatelessWidget { Widget build(BuildContext context) { return Scrollbar( child: GridView.builder( + primary: true, itemCount: 120, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), itemBuilder: (BuildContext context, int index) { diff --git a/examples/api/test/material/scrollbar/scrollbar.0_test.dart b/examples/api/test/material/scrollbar/scrollbar.0_test.dart new file mode 100644 index 0000000000..330f4f9408 --- /dev/null +++ b/examples/api/test/material/scrollbar/scrollbar.0_test.dart @@ -0,0 +1,21 @@ +// 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/material/scrollbar/scrollbar.0.dart' as example; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('Scrollbar.0 works well on all platforms', (WidgetTester tester) async { + + await tester.pumpWidget( + const example.ScrollbarExampleApp(), + ); + + final Finder buttonFinder = find.byType(Scrollbar); + await tester.drag(buttonFinder.last, const Offset(0, 100.0)); + + expect(tester.takeException(), isNull); + }, variant: TargetPlatformVariant.all()); +}