scroll_controller_direction 0.0.6 copy "scroll_controller_direction: ^0.0.6" to clipboard
scroll_controller_direction: ^0.0.6 copied to clipboard

Effortlessly control the direction of your Flutter app's ScrollController with the "scroll_controller_direction" package. Simplify scrolling actions by easily navigating up, down, or to a specific ind [...]

example/example.dart

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

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

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  final scrollController = ScrollController();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Scroll Controller Direction Example"),
      ),
      body: SizedBox(
        height: MediaQuery.of(context).size.height,
        child: Column(
          children: [
            Expanded(
              child: ListView.builder(
                controller: scrollController,
                itemCount: 100,
                itemBuilder: (context, index) {
                  return ListTile(
                    title: Text("Item $index"),
                    subtitle: const Text("Scroll controller example"),
                  );
                },
              ),
            ),
            Container(
              padding: const EdgeInsets.only(left: 32, right: 32),
              color: Colors.grey.shade300,
              height: 88,
              width: MediaQuery.of(context).size.width,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  ElevatedButton(
                      onPressed: () {
                        ScrollControllDirection.scrollUp(scrollController);
                      },
                      child: const Icon(
                        Icons.arrow_upward,
                        color: Colors.black,
                      )),
                  ElevatedButton(
                    onPressed: () {
                      ScrollControllDirection.scrollDown(scrollController);
                    },
                    child: const Icon(
                      Icons.arrow_downward,
                      color: Colors.black,
                    ),
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
7
likes
130
points
48
downloads

Publisher

unverified uploader

Weekly Downloads

Effortlessly control the direction of your Flutter app's ScrollController with the "scroll_controller_direction" package. Simplify scrolling actions by easily navigating up, down, or to a specific index in your scrollable content. Enhance user experience and streamline navigation in your Flutter projects with this lightweight and intuitive package..

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_riverpod

More

Packages that depend on scroll_controller_direction