diff --git a/dev/bots/check_code_samples.dart b/dev/bots/check_code_samples.dart index 5a2170a000..9eed55a638 100644 --- a/dev/bots/check_code_samples.dart +++ b/dev/bots/check_code_samples.dart @@ -314,5 +314,4 @@ final Set _knownMissingTests = { 'examples/api/test/widgets/image/image.loading_builder.0_test.dart', 'examples/api/test/widgets/scrollbar/raw_scrollbar.2_test.dart', 'examples/api/test/widgets/scrollbar/raw_scrollbar.desktop.0_test.dart', - 'examples/api/test/widgets/scrollbar/raw_scrollbar.shape.0_test.dart', }; diff --git a/examples/api/test/widgets/scrollbar/raw_scrollbar.shape.0_test.dart b/examples/api/test/widgets/scrollbar/raw_scrollbar.shape.0_test.dart new file mode 100644 index 0000000000..4825e9ff90 --- /dev/null +++ b/examples/api/test/widgets/scrollbar/raw_scrollbar.shape.0_test.dart @@ -0,0 +1,34 @@ +// 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/scrollbar/raw_scrollbar.shape.0.dart' as example; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('The thumb shape is a stadium border', (WidgetTester tester) async { + await tester.pumpWidget( + const example.ShapeExampleApp(), + ); + + expect(find.byType(RawScrollbar), findsOne); + expect(find.byType(ListView), findsOne); + + expect(find.text('0'), findsOne); + expect(find.text('1'), findsOne); + expect(find.text('4'), findsOne); + + await tester.pumpAndSettle(); + + expect( + find.byType(RawScrollbar), + paints + ..path(color: Colors.blue) + ..rrect( + rrect: RRect.fromLTRBR(786.5, 1.5, 798.5, 178.5, const Radius.circular(6)), + color: Colors.brown, + ), + ); + }); +}