Revert "Mixin for slotted RenderObjectWidgets and RenderBox (#94077)" (#94620)

This reverts commit 988959dad9.
This commit is contained in:
Michael Goderbauer
2021-12-03 10:39:11 -08:00
committed by GitHub
parent 13f25dddc2
commit 885a1482f8
11 changed files with 629 additions and 1002 deletions

View File

@@ -1,41 +0,0 @@
// 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/widgets.dart';
import 'package:flutter_api_samples/widgets/slotted_render_object_widget/slotted_multi_child_render_object_widget_mixin.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('shows two widgets arranged diagonally', (WidgetTester tester) async {
await tester.pumpWidget(
const example.ExampleWidget(),
);
expect(find.text('topLeft'), findsOneWidget);
expect(find.text('bottomRight'), findsOneWidget);
expect(
tester.getBottomRight(findContainerWithText('topLeft')),
tester.getTopLeft(findContainerWithText('bottomRight')),
);
expect(
tester.getSize(findContainerWithText('topLeft')),
const Size(200, 100),
);
expect(
tester.getSize(findContainerWithText('bottomRight')),
const Size(30, 60),
);
expect(
tester.getSize(find.byType(example.Diagonal)),
const Size(200 + 30, 100 + 60),
);
});
}
Finder findContainerWithText(String text) {
return find.ancestor(of: find.text(text), matching: find.byType(Container));
}