1// Copyright 2014 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'package:flutter_api_samples/cupertino/segmented_control/cupertino_sliding_segmented_control.0.dart'
6 as example;
7import 'package:flutter_test/flutter_test.dart';
8
9void main() {
10 testWidgets('Can change a selected segmented control', (WidgetTester tester) async {
11 await tester.pumpWidget(const example.SegmentedControlApp());
12
13 expect(find.text('Selected Segment: midnight'), findsOneWidget);
14 await tester.tap(find.text('Cerulean'));
15 await tester.pumpAndSettle();
16 expect(find.text('Selected Segment: cerulean'), findsOneWidget);
17 });
18}
19

Provided by KDAB

Privacy Policy
Learn more about Flutter for embedded and desktop on industrialflutter.com