aves_mio1/.flutter/examples/api/test/material/radio/radio.toggleable.0_test.dart
FabioMich66 19a982ede6
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
first commit
2026-03-05 15:51:30 +01:00

35 lines
1.1 KiB
Dart

// 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/radio/radio.toggleable.0.dart'
as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('StreamBuilder listens to internal stream', (
WidgetTester tester,
) async {
await tester.pumpWidget(const example.ToggleableExampleApp());
expect(find.byType(Radio<int>), findsExactly(5));
expect(find.text('Hercules Mulligan'), findsOne);
expect(find.text('Eliza Hamilton'), findsOne);
expect(find.text('Philip Schuyler'), findsOne);
expect(find.text('Maria Reynolds'), findsOne);
expect(find.text('Samuel Seabury'), findsOne);
for (int i = 0; i < 5; i++) {
await tester.tap(find.byType(Radio<int>).at(i));
await tester.pump();
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is RadioGroup<int> && widget.groupValue == i,
),
findsOne,
);
}
});
}