Skip to content

Nested scroll shadows #19

@talski

Description

@talski

I need the shadow to be only on the nearest scroll, in this example, it should only appears in vertical scroll.

It seems like the same bug as pull/13, but mine still occurs .

Screencast.From.2025-07-10.15-15-47.mp4
import 'package:flutter/material.dart';

import 'package:flutter_scroll_shadow/flutter_scroll_shadow.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(colorSchemeSeed: Colors.blue),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
 
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: (context, child) => Scaffold(
        body: Container(
          padding: EdgeInsets.all(32),
          child: ScrollShadow(
            child: ListView.builder(
              itemCount: 200,
              itemBuilder: (context, index) => index == 10
                  ? SingleChildScrollView(
                      scrollDirection: Axis.horizontal,
                      child: Row(
                        mainAxisSize: MainAxisSize.max,
                        children: List.generate(200, (index) => Text('ROW $index ')),
                      ),
                    )
                  : Text('Item $index'),
            ),
          ),
        ),
      ),
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions