パッケージ、リポジトリ、アプリカテゴリを検索

draggable_carousel_slider のカバー
パッケージ詳細v0.0.1

draggable_carousel_slider

ドラッグ可能なカルーセルスライダー用ウィジェットで、ループとカスタム子ウィジェットをサポートしています。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
42
いいね数
25
Pub ポイント
140

パッケージをインストール

flutter pub add draggable_carousel_slider

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

ループとカスタム子ウィジェットをサポートするドラッグ可能なカルーセルスライダーを提供するFlutterウィジェットです。直感的なドラッグ操作によるスムーズな水平スクロールを可能にし、画像、カード、または任意のカスタムコンテンツを視覚的に魅力的に表示するのに最適です。無限ループをサポートしており、継続的なコンテンツ表示に適しています。Android、iOS、Web、macOS、Windows、Linuxなどすべての主要プラットフォームで互換性があり、どこでも一貫した動作を保証します。インタラクティブでスワイプ可能なコンテンツ表示が必要なアプリに最適です。

用途

  • 画像ギャラリーの表示
  • プロダクトカロセルの作成
  • インタラクティブなオンボーディング画面の構築
  • 注目コンテンツの紹介
  • スワイプ可能なカードインターフェースの実装

主な機能

  • ドラッグ可能なジェスチャーのサポート
  • ループモード
  • カスタマイズ可能な子ウィジェット
  • クロスプラットフォーム互換性
  • スムーズなアニメーション
  • レスポンシブデザイン

適している対象

  • モバイルアプリ開発者
  • Webアプリケーション作成者
  • インタラクティブUIデザイナー
  • ECアプリビルダー
  • コンテンツ豊富なアプリケーション

注意事項

  • 大規模なデータセットの取り扱いには注意が必要です
  • 重い子ウィジェットがあるとパフォーマンスに影響する可能性があります
  • すべてのターゲットプラットフォームでテストが必要です
  • 組み込みのスタイリングオプションが限られている
  • 垂直スクロールに最適化されていません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Draggable Carousel Slider

Draggable Carousel Slider is a Flutter package that provides a customizable carousel slider widget with draggable functionality. It allows users to easily create interactive carousel sliders where items can be dragged.

Features

  • Draggable functionality: Items in the carousel slider can be dragged horizontally, providing an interactive user experience.
  • Looping option: The carousel slider supports looping through items, allowing seamless navigation from the last item back to the first.
  • Responsive design: The package includes features for handling various screen sizes and orientations, ensuring a consistent user experience across different devices.
  • Custom child widget: Users can supply their own custom widgets as carousel items, enabling a wide range of design possibilities.

Getting started

To start using the Draggable Carousel Slider package, you can simply add the package to your pubspec.yaml file and import it into your Flutter project.

dependencies:
  ...
  draggable_carousel_slider:

Usage

import 'package:draggable_carousel_slider/draggable_carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});
  @override
  State<MyApp> createState() => _MyAppPageState();
}

class _MyAppPageState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  Widget _image(
    String path,
    double width,
    double height, [
    bool shimmer = false,
  ]) =>
      ClipRRect(
        borderRadius: BorderRadius.circular(16),
        child: Image.network(
          path,
          width: width,
          height: height,
          fit: BoxFit.cover,
          loadingBuilder: (
            BuildContext context,
            Widget child,
            ImageChunkEvent? loadingProgress,
          ) => AnimatedCrossFade(
              firstChild: child,
              secondChild: Shimmer.fromColors(
                baseColor: Colors.grey.shade400,
                highlightColor: Colors.grey.shade700,
                enabled: true,
                period: const Duration(seconds: 2),
                child: Container(
                  width: width,
                  height: height,
                  color: Colors.black,
                ),
              ),
              crossFadeState: shimmer ||
                      ((child as Semantics).child as RawImage).image == null
                  ? CrossFadeState.showSecond
                  : CrossFadeState.showFirst,
              duration: const Duration(milliseconds: 300),
            ),
        ),
      );

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.deepPurple,
        ),
        useMaterial3: true,
      ),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: SafeArea(
          child: Padding(
            padding: const EdgeInsets.symmetric(vertical: 16.0),
            child: Center(
              child: DraggableSlider(
                loop: true,
                children: [
                  _image('https://picsum.photos/id/230/600/600', 300, 300),
                  _image(
                      'https://picsum.photos/id/431/600/600', 300, 300, true),
                  _image('https://picsum.photos/id/232/600/600', 300, 300),
                  _image('https://picsum.photos/id/433/600/600', 300, 300),
                  _image('https://picsum.photos/id/234/600/600', 300, 300),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。