CupertinoFormRow: Add an interactive example (#103041)

* `CupertinoFormRow`: Add an interactive example

* fix typo

* Update docs
This commit is contained in:
Taha Tesser
2022-05-05 08:58:53 +03:00
committed by GitHub
parent 81fd748ac2
commit 86e55df7f2
3 changed files with 166 additions and 42 deletions

View File

@@ -0,0 +1,23 @@
// 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/cupertino.dart';
import 'package:flutter_api_samples/cupertino/form_row/cupertino_form_row.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Cupertino form section displays cupertino form rows', (WidgetTester tester) async {
await tester.pumpWidget(
const example.CupertinoFormRowApp(),
);
expect(find.byType(CupertinoFormSection), findsOneWidget);
expect(find.byType(CupertinoFormRow), findsNWidgets(4));
expect(find.widgetWithText(CupertinoFormSection, 'Connectivity'), findsOneWidget);
expect(find.widgetWithText(CupertinoFormRow, 'Airplane Mode'), findsOneWidget);
expect(find.widgetWithText(CupertinoFormRow, 'Wi-Fi'), findsOneWidget);
expect(find.widgetWithText(CupertinoFormRow, 'Bluetooth'), findsOneWidget);
expect(find.widgetWithText(CupertinoFormRow, 'Mobile Data'), findsOneWidget);
});
}