flutter_custom_carousel 0.1.0+1 copy "flutter_custom_carousel: ^0.1.0+1" to clipboard
flutter_custom_carousel: ^0.1.0+1 copied to clipboard

A widget for creating fully custom, animated scrollable lists. It manages all the tricky scrolling logic and leaves the visual presentation up to you.

example/lib/main.dart

import 'dart:ui';

import 'package:example/views/views.dart';
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // Enable scrolling on desktop via mouse drag for the whole app.
      // This can be applied to specific carousels via `CustomCarousel.scrollBehavior`.
      scrollBehavior: AppScrollBehavior(),
      theme: ThemeData.dark()
          .copyWith(scaffoldBackgroundColor: const Color(0xFF151530)),
      home: const HomeView(),
    );
  }
}

// Create a subclass of ScrollBehavior that enables scrolling via mouse drag.
class AppScrollBehavior extends ScrollBehavior {
  @override
  Set<PointerDeviceKind> get dragDevices {
    final devices = Set<PointerDeviceKind>.from(super.dragDevices);
    devices.add(PointerDeviceKind.mouse);
    return devices;
  }
}
215
likes
140
pub points
83%
popularity

Publisher

verified publishergskinner.com

A widget for creating fully custom, animated scrollable lists. It manages all the tricky scrolling logic and leaves the visual presentation up to you.

Repository (GitHub)
View/report issues

Topics

#ui #list #widget #carousel #animation

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, flutter_animate

More

Packages that depend on flutter_custom_carousel