flutter_3d_carousel 1.0.2 copy "flutter_3d_carousel: ^1.0.2" to clipboard
flutter_3d_carousel: ^1.0.2 copied to clipboard

An interactive 3D carousel widget with smooth animations, perspective transforms, and gesture controls for showcasing content in Flutter applications.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: HomeScreen());
  }
}

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

  @override
  State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: CarouselWidget3D(
          radius: MediaQuery.sizeOf(context).width,
          childScale: 0.9,
          backgroundBlur: 3,
          dragEndBehavior: DragEndBehavior.snapToNearest,
          tapBehavior: TapBehavior.startAndFreeze,
          isDragInteractive: true,
          shouldRotate: true,
          spinWhileRotating: true,
          timeForFullRevolution: 20000,
          snapTimeInMillis: 100,
          perspectiveStrength: 0.001,
          dragSensitivity: 1.0,
          onValueChanged: (newValue) {
            // ignore: avoid_print
            print(newValue);
          },
          children: List.generate(
            colors.length,
            (index) => Container(
              width: MediaQuery.sizeOf(context).width,
              height: MediaQuery.sizeOf(context).height,
              color: colors[index],
            ),
          ),
        ),
      ),
    );
  }
}

List<Color> colors = [
  Colors.lightBlue,
  Colors.greenAccent,
  Colors.indigo,
  Colors.grey,
  Colors.yellow,
  Colors.purple,
];
23
likes
150
points
58
downloads

Publisher

verified publisherlordolumide.com

Weekly Downloads

An interactive 3D carousel widget with smooth animations, perspective transforms, and gesture controls for showcasing content in Flutter applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_3d_carousel