smooth_list_view 1.0.4 copy "smooth_list_view: ^1.0.4" to clipboard
smooth_list_view: ^1.0.4 copied to clipboard

ListView constructors that implement smooth scrolling when using a mouse.

example/lib/main.dart

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

const List<Color> colorList = [Colors.red, Colors.blue, Colors.green];

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool smooth = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      showPerformanceOverlay: false,
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: SmoothListView.builder(
          smoothScroll: smooth,
          duration: const Duration(milliseconds: 400),
          itemBuilder: (ctx, idx) {
            return Container(
              height: 200,
              width: 200,
              color: colorList[idx % colorList.length],
            );
          },
        ),
        floatingActionButton: FloatingActionButton(
          child: Icon(smooth ? Icons.toggle_on : Icons.toggle_off),
          onPressed: () {
            setState(() {
              smooth = !smooth;
            });
          },
        ),
      ),
    );
  }
}
25
likes
0
points
290
downloads

Publisher

unverified uploader

Weekly Downloads

ListView constructors that implement smooth scrolling when using a mouse.

Repository (GitHub)
View/report issues

Topics

#animation #ui #widget #web

License

unknown (license)

Dependencies

flutter

More

Packages that depend on smooth_list_view