scroll_snap_effect 0.0.3 copy "scroll_snap_effect: ^0.0.3" to clipboard
scroll_snap_effect: ^0.0.3 copied to clipboard

A Flutter package to create easy animation scroll snap effect in ListView

example/example.dart

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

void main() {}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primaryColor: Colors.blue,
      ),
      home: const ExamplePage(),
    );
  }
}

class ExamplePage extends StatelessWidget {
  const ExamplePage({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SizedBox(
          height: 100,
          width: double.infinity,
          child: ScrollSnapEffect(
            itemSize: 116,
            itemCount: 15,
            padding: const EdgeInsets.symmetric(horizontal: 20),
            onChanged: (index) {
              debugPrint('$index');
            },
            itemBuilder: (context, index) {
              return Padding(
                padding: const EdgeInsets.only(right: 16),
                child: SizedBox(
                  height: 100,
                  width: 100,
                  child: ColoredBox(
                    color: Colors.blue,
                    child: Center(
                      child: Text(
                        '$index',
                        style: const TextStyle(
                          color: Colors.white,
                          fontSize: 20,
                        ),
                      ),
                    ),
                  ),
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}
26
likes
150
pub points
49%
popularity

Publisher

verified publisherfarhanfadila.site

A Flutter package to create easy animation scroll snap effect in ListView

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on scroll_snap_effect