-
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
- Ensure that you have Flutter version 3.10 installed.
- Create a new Flutter project and replace the existing code in the main.dart file with the provided code.
- Run the Flutter application on a device or emulator.
- Observe that the app launches with a SelectableText widget inside a PageView.builder widget.
- Attempt to swipe left or right on the PageView to switch between pages.
- Notice that the swipe functionality is not working as expected and the pages are not changing.
Expected results
When running the Flutter application, the PageView.builder should display multiple pages containing the SelectableText.rich widget. The PageView should retain its swipe functionality, allowing the user to swipe left or right to navigate between the pages. The SelectableText widget should also function as intended, allowing the user to select and copy text within the widget.
Actual results
After upgrading to Flutter version 3.10 and running the application, the PageView.builder displays multiple pages with the SelectableText.rich widget. However, the swipe functionality of the PageView is disabled. It is not possible to swipe left or right to navigate between the pages. The expected swipe behavior is lost, making it difficult to switch between pages within the PageView.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
const String sampleText = '''
Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, “and what is the use of a book,” thought Alice “without pictures or conversations?”
So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.
''';
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('SelectableText Sample'),
),
body: PageView.builder(
itemCount: 3,
itemBuilder: (BuildContext context, int index) {
return MyPage(index: index);
},
),
),
);
}
}
class MyPage extends StatelessWidget {
final int index;
const MyPage({super.key, required this.index});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(16.0),
child: const Center(
child: SelectableText.rich(
TextSpan(
text: sampleText,
style: TextStyle(fontSize: 20.0),
),
),
),
);
}
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F82 darwin-arm64, locale tr-TR)
• Flutter version 3.10.5 on channel stable at /Volumes/Media/Development/Flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700
• Engine revision 45f6e00911
• Dart version 3.0.5
• DevTools version 2.23.1