Skip to content

Stretching overscroll with RTl Stretches in incorrect direction #113185

@youssefali424

Description

@youssefali424

Steps to Reproduce

  1. Add rtl support to flutter app

Expected results: Scroll stretch to be same as native android and stretch effect stretches towards the drag position

Actual results: stretch effect stretches towards opposite of the drag position

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark().copyWith(
        androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
      ),
      debugShowCheckedModeBanner: false,
      home: const Directionality(
        textDirection: TextDirection.rtl,
        // textDirection: TextDirection.ltr,
        child: Scaffold(
          body: SafeArea(
            child: Center(
              child: MyWidget(),
            ),
          ),
        ),
      ),
    );
  }
}

class MyWidget extends StatelessWidget {
  const MyWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 100,
      child: ListView.builder(
        itemBuilder: (context, index) => Container(
          width: 50,
          height: 100,
          color: Colors.amber[(index % 9 + 1) * 100],
          child: Center(child: Text('Entry $index')),
        ),
        itemCount: 10,
        padding: const EdgeInsets.all(8),
        scrollDirection: Axis.horizontal,
      ),
    );
  }
}

here two different videos when rtl support is added and another when ltr support is used

RTL 👇

Android.Emulator.-.Pixel_4_API_31_5554.2022-10-09.14-56-31.1.mp4

LTR 👇

Android.Emulator.-.Pixel_4_API_31_5554.2022-10-09.14-56-55.1.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.found in release: 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions