-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
Use the following code example below
- Run it on an iPad
- Type something into the text field
- Double tap on the entered code and use the share button
Basically do what the gif shows in the Add additional options in edit menu section of the release article here https://medium.com/flutter/whats-new-in-flutter-3-16-dba6cb1015d1 but on an iPad.
This can be reproduced on an iPad Simulator, too.
I suspect what's missing is what's described here. On an iPad, the share dialog needs to know where it should be shown. If nothing is passed for the position, it just crashes.
Looking at the source, it seems plausible.
The framework part doesn't pass source coordinates to the engine side:
flutter/packages/flutter/lib/src/widgets/editable_text.dart
Lines 2533 to 2536 in db7ef5b
| await SystemChannels.platform.invokeMethod( | |
| 'Share.invoke', | |
| text, | |
| ); |
Taking a further look at the engine and there's also no source rectangle passed to the share dialog:
The relevant PRs that introduced this are #132599 and flutter/engine#44554. Based on those, I think @LouiseHsu could help here.
Expected results
I'm able to share the text
Actual results
App crashes
Code sample
Code sample
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
home: Scaffold(
body: Center(
child: TextField(),
),
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.0 23A344 darwin-arm64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.84.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!