Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the `engine` subdirectory and enforces that these files stay formatted with a presubmit check. **Reviewers:** Please carefully review all the commits except for the one titled "formatted". The "formatted" commit was auto-generated by running `dev/tools/format.sh -a -f`. The other commits were hand-crafted to prepare the repo for the formatting change. I recommend reviewing the commits one-by-one via the "Commits" tab and avoiding Github's "Files changed" tab as it will likely slow down your browser because of the size of this PR. --------- Co-authored-by: Kate Lovett <katelovett@google.com> Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8e0993eda8
commit
5491c8c146
@@ -8,9 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Switch tabs in the TabBar', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.TabBarApp(),
|
||||
);
|
||||
await tester.pumpWidget(const example.TabBarApp());
|
||||
|
||||
final TabBar tabBar = tester.widget<TabBar>(find.byType(TabBar));
|
||||
expect(tabBar.tabs.length, 3);
|
||||
|
||||
@@ -8,9 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Switch tabs in the TabBar', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.TabBarApp(),
|
||||
);
|
||||
await tester.pumpWidget(const example.TabBarApp());
|
||||
|
||||
final TabBar tabBar = tester.widget<TabBar>(find.byType(TabBar));
|
||||
expect(tabBar.tabs.length, 3);
|
||||
|
||||
@@ -14,9 +14,7 @@ void main() {
|
||||
const String secondaryTabLabel1 = 'Overview';
|
||||
const String secondaryTabLabel2 = 'Specifications';
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.TabBarApp(),
|
||||
);
|
||||
await tester.pumpWidget(const example.TabBarApp());
|
||||
|
||||
final TabBar primaryTabBar = tester.widget<TabBar>(find.byType(TabBar).last);
|
||||
expect(primaryTabBar.tabs.length, 3);
|
||||
|
||||
@@ -7,22 +7,25 @@ import 'package:flutter_api_samples/material/tabs/tab_bar.indicator_animation.0.
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('TabBar.indicatorAnimation can customize tab indicator animation', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.IndicatorAnimationExampleApp(),
|
||||
);
|
||||
testWidgets('TabBar.indicatorAnimation can customize tab indicator animation', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const example.IndicatorAnimationExampleApp());
|
||||
|
||||
final RenderBox tabBarBox = tester.firstRenderObject<RenderBox>(find.byType(TabBar));
|
||||
|
||||
late RRect indicatorRRect;
|
||||
|
||||
expect(tabBarBox, paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}));
|
||||
expect(
|
||||
tabBarBox,
|
||||
paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}),
|
||||
);
|
||||
expect(indicatorRRect.left, equals(16.0));
|
||||
expect(indicatorRRect.top, equals(45.0));
|
||||
expect(indicatorRRect.right, closeTo(142.9, 0.1));
|
||||
@@ -33,13 +36,16 @@ void main() {
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
|
||||
expect(tabBarBox, paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}));
|
||||
expect(
|
||||
tabBarBox,
|
||||
paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}),
|
||||
);
|
||||
expect(indicatorRRect.left, closeTo(107.5, 0.1));
|
||||
expect(indicatorRRect.top, equals(45.0));
|
||||
expect(indicatorRRect.right, closeTo(348.2, 0.1));
|
||||
@@ -49,13 +55,16 @@ void main() {
|
||||
await tester.tap(find.text('Short Tab').first);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(tabBarBox, paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}));
|
||||
expect(
|
||||
tabBarBox,
|
||||
paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}),
|
||||
);
|
||||
expect(indicatorRRect.left, equals(16.0));
|
||||
expect(indicatorRRect.top, equals(45.0));
|
||||
expect(indicatorRRect.right, closeTo(142.9, 0.1));
|
||||
@@ -70,13 +79,16 @@ void main() {
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
|
||||
expect(tabBarBox, paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}));
|
||||
expect(
|
||||
tabBarBox,
|
||||
paints..something((Symbol method, List<dynamic> arguments) {
|
||||
if (method != #drawRRect) {
|
||||
return false;
|
||||
}
|
||||
indicatorRRect = arguments[0] as RRect;
|
||||
return true;
|
||||
}),
|
||||
);
|
||||
expect(indicatorRRect.left, closeTo(51.0, 0.1));
|
||||
expect(indicatorRRect.top, equals(45.0));
|
||||
expect(indicatorRRect.right, closeTo(221.4, 0.1));
|
||||
|
||||
Reference in New Issue
Block a user