[flutter roll] Revert "LinkedText (Linkify)" (#134955)

Reverts flutter/flutter#125927

context: b/300804374

Looks like a g3 fix might involve changing the names of widget on the customer app, and I am not sure if that would be the right approach forward. Putting up a revert to be safe for now.
This commit is contained in:
Xilai Zhang
2023-09-18 12:49:10 -07:00
committed by GitHub
parent 9dd3e1e6fc
commit 6425a3b431
18 changed files with 0 additions and 2520 deletions

View File

@@ -1,36 +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/material.dart';
import 'package:flutter_api_samples/painting/text_linker/text_linker.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('can tap different link types with different results', (WidgetTester tester) async {
await tester.pumpWidget(
const example.TextLinkerApp(),
);
final Finder textFinder = find.descendant(
of: find.byType(SelectionArea),
matching: find.byType(Text),
);
expect(textFinder, findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getTopLeft(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: https://www.twitter.com/FlutterDev'), findsOneWidget);
await tester.tapAt(tester.getTopLeft(find.byType(Scaffold)));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getCenter(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: www.flutter.dev'), findsOneWidget);
});
}

View File

@@ -1,36 +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/material.dart';
import 'package:flutter_api_samples/painting/text_linker/text_linker.1.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('can tap different link types with different results', (WidgetTester tester) async {
await tester.pumpWidget(
const example.TextLinkerApp(),
);
final Finder textFinder = find.descendant(
of: find.byType(SelectionArea),
matching: find.byType(Text),
);
expect(textFinder, findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getTopLeft(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: https://www.twitter.com/FlutterDev'), findsOneWidget);
await tester.tapAt(tester.getTopLeft(find.byType(Scaffold)));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getCenter(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: www.flutter.dev'), findsOneWidget);
});
}

View File

@@ -1,27 +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/material.dart';
import 'package:flutter_api_samples/widgets/linked_text/linked_text.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('tapping a link shows a dialog with the tapped uri', (WidgetTester tester) async {
await tester.pumpWidget(
const example.LinkedTextApp(),
);
final Finder textFinder = find.descendant(
of: find.byType(LinkedText),
matching: find.byType(RichText),
);
expect(textFinder, findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getCenter(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: https://www.flutter.dev'), findsOneWidget);
});
}

View File

@@ -1,27 +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/material.dart';
import 'package:flutter_api_samples/widgets/linked_text/linked_text.1.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('tapping a Twitter handle shows a dialog with the uri of the user', (WidgetTester tester) async {
await tester.pumpWidget(
const example.LinkedTextApp(),
);
final Finder textFinder = find.descendant(
of: find.byType(LinkedText),
matching: find.byType(RichText),
);
expect(textFinder, findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getCenter(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: https://www.twitter.com/FlutterDev'), findsOneWidget);
});
}

View File

@@ -1,27 +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/material.dart';
import 'package:flutter_api_samples/widgets/linked_text/linked_text.2.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('can tap links generated from TextSpans', (WidgetTester tester) async {
await tester.pumpWidget(
const example.LinkedTextApp(),
);
final Finder textFinder = find.descendant(
of: find.byType(LinkedText),
matching: find.byType(RichText),
);
expect(textFinder, findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getCenter(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: https://www.flutter.dev'), findsOneWidget);
});
}

View File

@@ -1,36 +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/material.dart';
import 'package:flutter_api_samples/widgets/linked_text/linked_text.3.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('can tap different link types with different results', (WidgetTester tester) async {
await tester.pumpWidget(
const example.LinkedTextApp(),
);
final Finder textFinder = find.descendant(
of: find.byType(SelectionArea),
matching: find.byType(Text),
);
expect(textFinder, findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getTopLeft(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: https://www.twitter.com/FlutterDev'), findsOneWidget);
await tester.tapAt(tester.getTopLeft(find.byType(Scaffold)));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsNothing);
await tester.tapAt(tester.getCenter(textFinder));
await tester.pumpAndSettle();
expect(find.byType(AlertDialog), findsOneWidget);
expect(find.text('You tapped: www.flutter.dev'), findsOneWidget);
});
}