mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Dart 3.9 / Flutter 3.35 [first LLM release] (#2714)
I got carried away with Gemini and basically rewrote CI and the release process for the new LLM reality. This work was largely completed by Gemini. - Bump all SDK versions to the current beta (3.9.0-0) - Run `flutter channel beta` - Wrote `ci_script.dart` to replace the bash scripts - Converted repository to pub workspace #2499 - Added llm.md and release.md - Added redirect for deprecated Samples Index ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I have added sample code updates to the [changelog]. - [x] I updated/added relevant documentation (doc comments with `///`).
This commit is contained in:
@@ -37,7 +37,10 @@ void main() {
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsOneWidget);
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.iOS:
|
||||
expect(find.byType(CupertinoTextSelectionToolbarButton), findsNothing);
|
||||
expect(
|
||||
find.byType(CupertinoTextSelectionToolbarButton),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.byType(CupertinoButton), findsNWidgets(2));
|
||||
case TargetPlatform.macOS:
|
||||
expect(find.byType(CupertinoButton), findsNWidgets(2));
|
||||
@@ -52,7 +55,10 @@ void main() {
|
||||
case TargetPlatform.linux:
|
||||
case TargetPlatform.windows:
|
||||
expect(find.byType(CupertinoButton), findsNWidgets(1));
|
||||
expect(find.byType(DesktopTextSelectionToolbarButton), findsNothing);
|
||||
expect(
|
||||
find.byType(DesktopTextSelectionToolbarButton),
|
||||
findsNothing,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Shows default buttons in a custom context menu', (tester) async {
|
||||
testWidgets('Shows default buttons in a custom context menu', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const MyApp());
|
||||
|
||||
// Navigate to the CustomMenuPage example.
|
||||
@@ -33,7 +35,10 @@ void main() {
|
||||
|
||||
// A custom context menu is shown, and the buttons are the default ones.
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsNothing);
|
||||
expect(find.byType(CupertinoAdaptiveTextSelectionToolbar), findsNothing);
|
||||
expect(
|
||||
find.byType(CupertinoAdaptiveTextSelectionToolbar),
|
||||
findsNothing,
|
||||
);
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.iOS:
|
||||
expect(
|
||||
@@ -47,7 +52,10 @@ void main() {
|
||||
);
|
||||
case TargetPlatform.android:
|
||||
case TargetPlatform.fuchsia:
|
||||
expect(find.byType(TextSelectionToolbarTextButton), findsNWidgets(1));
|
||||
expect(
|
||||
find.byType(TextSelectionToolbarTextButton),
|
||||
findsNWidgets(1),
|
||||
);
|
||||
case TargetPlatform.linux:
|
||||
case TargetPlatform.windows:
|
||||
expect(
|
||||
|
||||
@@ -55,7 +55,10 @@ void main() {
|
||||
);
|
||||
case TargetPlatform.android:
|
||||
case TargetPlatform.fuchsia:
|
||||
expect(find.byType(TextSelectionToolbarTextButton), findsNWidgets(1));
|
||||
expect(
|
||||
find.byType(TextSelectionToolbarTextButton),
|
||||
findsNWidgets(1),
|
||||
);
|
||||
case TargetPlatform.linux:
|
||||
case TargetPlatform.windows:
|
||||
expect(
|
||||
|
||||
@@ -61,7 +61,10 @@ void main() {
|
||||
);
|
||||
case TargetPlatform.android:
|
||||
case TargetPlatform.fuchsia:
|
||||
expect(find.byType(TextSelectionToolbarTextButton), findsNWidgets(3));
|
||||
expect(
|
||||
find.byType(TextSelectionToolbarTextButton),
|
||||
findsNWidgets(3),
|
||||
);
|
||||
case TargetPlatform.linux:
|
||||
case TargetPlatform.windows:
|
||||
expect(
|
||||
@@ -111,7 +114,10 @@ void main() {
|
||||
);
|
||||
case TargetPlatform.android:
|
||||
case TargetPlatform.fuchsia:
|
||||
expect(find.byType(TextSelectionToolbarTextButton), findsNWidgets(4));
|
||||
expect(
|
||||
find.byType(TextSelectionToolbarTextButton),
|
||||
findsNWidgets(4),
|
||||
);
|
||||
case TargetPlatform.linux:
|
||||
case TargetPlatform.windows:
|
||||
expect(
|
||||
|
||||
@@ -44,7 +44,10 @@ void main() {
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsOneWidget);
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.iOS:
|
||||
expect(find.byType(CupertinoTextSelectionToolbar), findsOneWidget);
|
||||
expect(
|
||||
find.byType(CupertinoTextSelectionToolbar),
|
||||
findsOneWidget,
|
||||
);
|
||||
case TargetPlatform.android:
|
||||
expect(find.byType(TextSelectionToolbar), findsOneWidget);
|
||||
case TargetPlatform.fuchsia:
|
||||
@@ -83,7 +86,10 @@ void main() {
|
||||
case TargetPlatform.iOS:
|
||||
case TargetPlatform.android:
|
||||
case TargetPlatform.fuchsia:
|
||||
expect(find.byType(CupertinoTextSelectionToolbar), findsOneWidget);
|
||||
expect(
|
||||
find.byType(CupertinoTextSelectionToolbar),
|
||||
findsOneWidget,
|
||||
);
|
||||
case TargetPlatform.macOS:
|
||||
case TargetPlatform.linux:
|
||||
case TargetPlatform.windows:
|
||||
@@ -96,7 +102,10 @@ void main() {
|
||||
// Tap the next field to hide the context menu.
|
||||
await tester.tap(find.byType(CupertinoTextField).at(1));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(CupertinoAdaptiveTextSelectionToolbar), findsNothing);
|
||||
expect(
|
||||
find.byType(CupertinoAdaptiveTextSelectionToolbar),
|
||||
findsNothing,
|
||||
);
|
||||
|
||||
// Right click on the fixed CupertinoTextField.
|
||||
gesture = await tester.startGesture(
|
||||
@@ -113,7 +122,10 @@ void main() {
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsOneWidget);
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.iOS:
|
||||
expect(find.byType(CupertinoTextSelectionToolbar), findsOneWidget);
|
||||
expect(
|
||||
find.byType(CupertinoTextSelectionToolbar),
|
||||
findsOneWidget,
|
||||
);
|
||||
case TargetPlatform.android:
|
||||
expect(find.byType(TextSelectionToolbar), findsOneWidget);
|
||||
case TargetPlatform.fuchsia:
|
||||
@@ -145,7 +157,10 @@ void main() {
|
||||
|
||||
// The DesktopTextSelectionToolbar is shown for all platforms.
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsNothing);
|
||||
expect(find.byType(CupertinoAdaptiveTextSelectionToolbar), findsNothing);
|
||||
expect(
|
||||
find.byType(CupertinoAdaptiveTextSelectionToolbar),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.byType(DesktopTextSelectionToolbar), findsOneWidget);
|
||||
|
||||
// Tap the next field to hide the context menu.
|
||||
@@ -168,7 +183,10 @@ void main() {
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsOneWidget);
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.iOS:
|
||||
expect(find.byType(CupertinoTextSelectionToolbar), findsOneWidget);
|
||||
expect(
|
||||
find.byType(CupertinoTextSelectionToolbar),
|
||||
findsOneWidget,
|
||||
);
|
||||
case TargetPlatform.android:
|
||||
expect(find.byType(TextSelectionToolbar), findsOneWidget);
|
||||
case TargetPlatform.fuchsia:
|
||||
|
||||
@@ -5,43 +5,49 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Gives correct behavior for all values of contextMenuBuilder', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const MyApp());
|
||||
testWidgets(
|
||||
'Gives correct behavior for all values of contextMenuBuilder',
|
||||
(
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const MyApp());
|
||||
|
||||
// Navigate to the GlobalSelectionPage example.
|
||||
await tester.dragUntilVisible(
|
||||
find.text(GlobalSelectionPage.title),
|
||||
find.byType(ListView),
|
||||
const Offset(0.0, -100.0),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text(GlobalSelectionPage.title));
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byType(AppBar),
|
||||
matching: find.text(GlobalSelectionPage.title),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
// Navigate to the GlobalSelectionPage example.
|
||||
await tester.dragUntilVisible(
|
||||
find.text(GlobalSelectionPage.title),
|
||||
find.byType(ListView),
|
||||
const Offset(0.0, -100.0),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text(GlobalSelectionPage.title));
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byType(AppBar),
|
||||
matching: find.text(GlobalSelectionPage.title),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
// Right click on the plain Text widget.
|
||||
TestGesture gesture = await tester.startGesture(
|
||||
tester.getCenter(
|
||||
find.descendant(of: find.byType(ListView), matching: find.byType(Text)),
|
||||
),
|
||||
kind: PointerDeviceKind.mouse,
|
||||
buttons: kSecondaryMouseButton,
|
||||
);
|
||||
await tester.pump();
|
||||
await gesture.up();
|
||||
await gesture.removePointer();
|
||||
await tester.pumpAndSettle();
|
||||
// Right click on the plain Text widget.
|
||||
TestGesture gesture = await tester.startGesture(
|
||||
tester.getCenter(
|
||||
find.descendant(
|
||||
of: find.byType(ListView),
|
||||
matching: find.byType(Text),
|
||||
),
|
||||
),
|
||||
kind: PointerDeviceKind.mouse,
|
||||
buttons: kSecondaryMouseButton,
|
||||
);
|
||||
await tester.pump();
|
||||
await gesture.up();
|
||||
await gesture.removePointer();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// The default context menu is shown with a custom button.
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsOneWidget);
|
||||
expect(find.text('Back'), findsOneWidget);
|
||||
});
|
||||
// The default context menu is shown with a custom button.
|
||||
expect(find.byType(AdaptiveTextSelectionToolbar), findsOneWidget);
|
||||
expect(find.text('Back'), findsOneWidget);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,9 @@ List<TextSelectionPoint> globalize(
|
||||
RenderBox box,
|
||||
) {
|
||||
return points.map<TextSelectionPoint>((point) {
|
||||
return TextSelectionPoint(box.localToGlobal(point.point), point.direction);
|
||||
return TextSelectionPoint(
|
||||
box.localToGlobal(point.point),
|
||||
point.direction,
|
||||
);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user