Skip to content

PageView Swipe Functionality Lost After Upgrading to Flutter 3.10 with SelectableText.rich #130198

@burhanaksendir

Description

@burhanaksendir

Is there an existing issue for this?

Steps to reproduce

  1. Ensure that you have Flutter version 3.10 installed.
  2. Create a new Flutter project and replace the existing code in the main.dart file with the provided code.
  3. Run the Flutter application on a device or emulator.
  4. Observe that the app launches with a SelectableText widget inside a PageView.builder widget.
  5. Attempt to swipe left or right on the PageView to switch between pages.
  6. 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

Metadata

Metadata

Labels

P2Important issues not at the top of the work listc: regressionIt was better in the past than it is nowf: gesturesflutter/packages/flutter/gestures repository.found in release: 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions