Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

[scrollable_positioned_list] SelectionArea not working with ScrollablePositionedList #425

@asjqkkkk

Description

@asjqkkkk

see #111572

Environment

on windows

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.1, on Microsoft Windows [版本 10.0.22000.856], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.2)
[√] Android Studio (version 2021.2)
[√] Connected device (2 available)
[√] HTTP Host Availability

! Doctor found issues in 2 categories

Minimal Project

import 'package:flutter/material.dart';
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';

void main() => runApp(const HomePage());

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: SelectionArea(
              child: ScrollablePositionedList.builder(
            itemCount: list.length,
            itemBuilder: (ctx, idx) {
              return list[idx];
            },
          )),
        ),
      ),
    );
  }
}

const List<Widget> list = [
  Text('aaa'),
  Text('bbb'),
  Icon(Icons.confirmation_num_sharp),
  Text.rich(
    TextSpan(text: 'xxx', style: TextStyle(color: Colors.blue)),
  ),
  Text('ccc'),
];

Description

SelectionArea works great with ListView
image

///if you change ScrollablePositionedList.builder to ListView
...
          child: SelectionArea(child: ListView(children: list)),
...

but it doesn't work with ScrollablePositionedList, only Ctrl+A works
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions