Skip to content

StretchingOverscrollIndicator reset scrolling offset #97867

@farhanfadila1717

Description

@farhanfadila1717

Steps to Reproduce

When i use StretchingOverscrollIndicator widget on ListView its reset scrolling offset, look same in emulator and my physical device
Expected results:
Android 12 overscroll effect/ Stretch effect

Actual results:

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

const colors = [
  Colors.amber,
  Colors.purple,
  Colors.green,
  Colors.grey,
  Colors.cyan
];

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: StretchingOverscrollIndicator(
        axisDirection: AxisDirection.up,
        child: ListView.builder(
          itemCount: colors.length,
          itemBuilder: (context, index) {
            return Padding(
              padding: const EdgeInsets.only(bottom: 20),
              child: SizedBox(
                height: 200,
                width: double.infinity,
                child: ColoredBox(
                  color: colors[index],
                  child: Center(
                    child: Text(
                      index.toString(),
                    ),
                  ),
                ),
              ),
            );
          },
        ),
      ),
    );
  }
}
Logs
screen-20220205-204433_2.mp4

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: scrollingViewports, list views, slivers, etc.found in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: 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