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
@@ -3,15 +3,12 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_api_samples/widgets/async/future_builder.0.dart'
|
||||
as example;
|
||||
import 'package:flutter_api_samples/widgets/async/future_builder.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.FutureBuilderExampleApp(),
|
||||
);
|
||||
await tester.pumpWidget(const example.FutureBuilderExampleApp());
|
||||
|
||||
expect(find.byType(CircularProgressIndicator), findsOne);
|
||||
expect(find.text('Awaiting result...'), findsOne);
|
||||
|
||||
@@ -5,15 +5,12 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_api_samples/widgets/async/stream_builder.0.dart'
|
||||
as example;
|
||||
import 'package:flutter_api_samples/widgets/async/stream_builder.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.StreamBuilderExampleApp(),
|
||||
);
|
||||
await tester.pumpWidget(const example.StreamBuilderExampleApp());
|
||||
|
||||
expect(find.byType(CircularProgressIndicator), findsOneWidget);
|
||||
expect(find.text('Awaiting bids...'), findsOneWidget);
|
||||
@@ -37,11 +34,7 @@ void main() {
|
||||
controller.addError('Unexpected error!', StackTrace.empty);
|
||||
};
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: example.BidsStatus(bids: controller.stream),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byIcon(Icons.error_outline), findsOneWidget);
|
||||
@@ -50,11 +43,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('BidsStatus correctly displays none state', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: example.BidsStatus(bids: null),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(const MaterialApp(home: example.BidsStatus(bids: null)));
|
||||
|
||||
expect(find.byIcon(Icons.info), findsOneWidget);
|
||||
expect(find.text('Select a lot'), findsOneWidget);
|
||||
@@ -64,11 +53,7 @@ void main() {
|
||||
final StreamController<int> controller = StreamController<int>();
|
||||
addTearDown(controller.close);
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: example.BidsStatus(bids: controller.stream),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));
|
||||
|
||||
expect(find.byType(CircularProgressIndicator), findsOneWidget);
|
||||
expect(find.text('Awaiting bids...'), findsOneWidget);
|
||||
@@ -82,11 +67,7 @@ void main() {
|
||||
controller.add(1);
|
||||
};
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: example.BidsStatus(bids: controller.stream),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byIcon(Icons.check_circle_outline), findsOneWidget);
|
||||
@@ -97,11 +78,7 @@ void main() {
|
||||
final StreamController<int> controller = StreamController<int>();
|
||||
controller.close();
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: example.BidsStatus(bids: controller.stream),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byIcon(Icons.info), findsOneWidget);
|
||||
|
||||
Reference in New Issue
Block a user