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
@@ -6,14 +6,15 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_api_samples/material/context_menu/context_menu_controller.0.dart' as example;
|
||||
import 'package:flutter_api_samples/material/context_menu/context_menu_controller.0.dart'
|
||||
as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('showing and hiding the custom context menu in the whole app', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.ContextMenuControllerExampleApp(),
|
||||
);
|
||||
testWidgets('showing and hiding the custom context menu in the whole app', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const example.ContextMenuControllerExampleApp());
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
|
||||
@@ -6,14 +6,15 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_api_samples/material/context_menu/editable_text_toolbar_builder.0.dart' as example;
|
||||
import 'package:flutter_api_samples/material/context_menu/editable_text_toolbar_builder.0.dart'
|
||||
as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('showing and hiding the context menu in TextField with custom buttons', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.EditableTextToolbarBuilderExampleApp(),
|
||||
);
|
||||
testWidgets('showing and hiding the context menu in TextField with custom buttons', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const example.EditableTextToolbarBuilderExampleApp());
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
|
||||
@@ -6,14 +6,15 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_api_samples/material/context_menu/editable_text_toolbar_builder.1.dart' as example;
|
||||
import 'package:flutter_api_samples/material/context_menu/editable_text_toolbar_builder.1.dart'
|
||||
as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('showing and hiding the custom context menu in TextField with a specific selection', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.EditableTextToolbarBuilderExampleApp(),
|
||||
);
|
||||
testWidgets('showing and hiding the custom context menu in TextField with a specific selection', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const example.EditableTextToolbarBuilderExampleApp());
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
@@ -40,14 +41,15 @@ void main() {
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsNothing);
|
||||
|
||||
// Select the email address.
|
||||
final EditableTextState state =
|
||||
tester.state<EditableTextState>(find.byType(EditableText));
|
||||
state.updateEditingValue(state.textEditingValue.copyWith(
|
||||
selection: TextSelection(
|
||||
baseOffset: example.text.indexOf(example.emailAddress),
|
||||
extentOffset: example.text.length,
|
||||
final EditableTextState state = tester.state<EditableTextState>(find.byType(EditableText));
|
||||
state.updateEditingValue(
|
||||
state.textEditingValue.copyWith(
|
||||
selection: TextSelection(
|
||||
baseOffset: example.text.indexOf(example.emailAddress),
|
||||
extentOffset: example.text.length,
|
||||
),
|
||||
),
|
||||
));
|
||||
);
|
||||
await tester.pump();
|
||||
|
||||
// Right clicking the Text in the TextField shows the custom context menu
|
||||
|
||||
@@ -6,14 +6,15 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_api_samples/material/context_menu/editable_text_toolbar_builder.2.dart' as example;
|
||||
import 'package:flutter_api_samples/material/context_menu/editable_text_toolbar_builder.2.dart'
|
||||
as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('showing and hiding the context menu in TextField with a custom toolbar', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.EditableTextToolbarBuilderExampleApp(),
|
||||
);
|
||||
testWidgets('showing and hiding the context menu in TextField with a custom toolbar', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const example.EditableTextToolbarBuilderExampleApp());
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
|
||||
@@ -6,14 +6,15 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_api_samples/material/context_menu/selectable_region_toolbar_builder.0.dart' as example;
|
||||
import 'package:flutter_api_samples/material/context_menu/selectable_region_toolbar_builder.0.dart'
|
||||
as example;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('showing and hiding the custom context menu on SelectionArea', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const example.SelectableRegionToolbarBuilderExampleApp(),
|
||||
);
|
||||
testWidgets('showing and hiding the custom context menu on SelectionArea', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const example.SelectableRegionToolbarBuilderExampleApp());
|
||||
|
||||
expect(BrowserContextMenu.enabled, !kIsWeb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user