flutter_scroll_shadow 1.2.6 copy "flutter_scroll_shadow: ^1.2.6" to clipboard
flutter_scroll_shadow: ^1.2.6 copied to clipboard

ScrollShadow adds shadows to a scrollable child. Supports ScrollController and vertical or horizontal orientation.

example/lib/main.dart

// Flutter imports:
import 'package:flutter/material.dart';

// Package imports:
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) => MaterialApp(
        title: 'ScrollShadow Example',
        theme: ThemeData(primarySwatch: Colors.blue),
        home: const MyHomePage(),
      );
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text(
            '   Vertical                    |                    Horizontal',
          ),
          centerTitle: true,
        ),
        body: Row(
          children: [
            // Vertically-scrolling child
            Expanded(
              child: ScrollShadow(
                color: Colors.grey,
                child: ListView(
                  scrollDirection: Axis.vertical,
                  children: List.generate(
                    15,
                    (index) => ListTile(title: Text('Element $index')),
                  ),
                ),
              ),
            ),

            // Horizontally-scrolling child
            Expanded(
              child: ScrollShadow(
                color: Colors.grey,
                child: ListView(
                  scrollDirection: Axis.horizontal,
                  children: List.generate(
                    5,
                    (index) => SizedBox(
                      width: 100,
                      child: RotatedBox(
                        quarterTurns: 1,
                        child: Text('Element $index'),
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      );
}
copied to clipboard
37
likes
160
points
80.4k
downloads

Publisher

verified publisherinsideapp.it

Weekly Downloads

2024.09.20 - 2025.04.04

ScrollShadow adds shadows to a scrollable child. Supports ScrollController and vertical or horizontal orientation.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_scroll_shadow