Remove obsolete Cupertino fixture coverage
Keep the shared UI primitive tests focused on the app's Material-only behavior and remove alternate-host fixtures that no longer represent supported rendering.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -15,25 +14,12 @@ const _names = ['Needs you', 'Usage', 'Filter', 'Sort', 'Select'];
|
||||
Key _key(String name) => ValueKey('action.$name');
|
||||
|
||||
/// An icon action like the list bars' own, at the host's touch target.
|
||||
Widget _icon(bool cupertino, String name, VoidCallback onPressed) => cupertino
|
||||
? Semantics(
|
||||
button: true,
|
||||
label: name,
|
||||
excludeSemantics: true,
|
||||
child: CupertinoButton(
|
||||
key: _key(name),
|
||||
padding: EdgeInsets.zero,
|
||||
minimumSize: const Size.square(kMinInteractiveDimensionCupertino),
|
||||
onPressed: onPressed,
|
||||
child: const Icon(CupertinoIcons.circle),
|
||||
),
|
||||
)
|
||||
: IconButton(
|
||||
key: _key(name),
|
||||
tooltip: name,
|
||||
onPressed: onPressed,
|
||||
icon: const Icon(Icons.circle_outlined),
|
||||
);
|
||||
Widget _icon(bool cupertino, String name, VoidCallback onPressed) => IconButton(
|
||||
key: _key(name),
|
||||
tooltip: name,
|
||||
onPressed: onPressed,
|
||||
icon: const Icon(Icons.circle_outlined),
|
||||
);
|
||||
|
||||
/// The Runs bar's shape: a bell that always stays, then four that may move.
|
||||
List<Widget> _actions(bool cupertino, List<String> pressed) => [
|
||||
@@ -52,22 +38,14 @@ List<Widget> _actions(bool cupertino, List<String> pressed) => [
|
||||
];
|
||||
|
||||
Widget _app(bool cupertino, SegmentedBar bar, {Brightness? brightness}) =>
|
||||
cupertino
|
||||
? CupertinoApp(
|
||||
theme: CupertinoThemeData(brightness: brightness),
|
||||
home: CupertinoPageScaffold(
|
||||
navigationBar: bar,
|
||||
child: const SizedBox.expand(),
|
||||
),
|
||||
)
|
||||
: MaterialApp(
|
||||
theme: ThemeData(brightness: brightness ?? Brightness.light),
|
||||
home: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: bar,
|
||||
body: const SizedBox.expand(),
|
||||
),
|
||||
);
|
||||
MaterialApp(
|
||||
theme: ThemeData(brightness: brightness ?? Brightness.light),
|
||||
home: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: bar,
|
||||
body: const SizedBox.expand(),
|
||||
),
|
||||
);
|
||||
|
||||
/// Pumps the bar and the frame its More menu settles in.
|
||||
Future<void> _pump(WidgetTester tester, Widget app) async {
|
||||
@@ -87,8 +65,9 @@ bool _whole(WidgetTester tester, String text) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
final host = cupertino ? 'Cupertino' : 'Material';
|
||||
{
|
||||
const cupertino = false;
|
||||
const host = 'Material';
|
||||
for (final width in [240.0, 270.0, 320.0]) {
|
||||
for (final brightness in Brightness.values) {
|
||||
testWidgets('$host ${brightness.name} ${width.toInt()}px: the title '
|
||||
@@ -126,7 +105,7 @@ void main() {
|
||||
for (final name in shown) tester.getRect(find.byKey(_key(name))),
|
||||
tester.getRect(more),
|
||||
];
|
||||
final target = cupertino ? 44.0 : 48.0;
|
||||
const target = 48.0;
|
||||
for (final (index, rect) in rects.indexed) {
|
||||
expect(rect.width, greaterThanOrEqualTo(target));
|
||||
expect(rect.height, greaterThanOrEqualTo(target));
|
||||
|
||||
Reference in New Issue
Block a user