カテゴリー・パッケージ・リポジトリを検索

flutter_carousel_slider のカバー
パッケージ詳細v1.1.0

flutter_carousel_slider

Flutter用のカスタマイズ可能なカルーセルスライダー。無限スライド、カスタムインジケーター、カスタムアニメーションをサポートし、多数の事前構築されたインジケーターとアニメーションを備えています。

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

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

flutter pub add flutter_carousel_slider

パッケージ概要

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

Flutter向けに高度にカスタマイズ可能なカルーセルスライダーで、アイテム間のスムーズかつ無限のスライドを可能にします。カスタムインジケーターとアニメーションをサポートし、視覚的なインジケーターおよび遷移効果のさまざまな事前構築済みオプションを提供します。複数のプラットフォームで画像、製品、コンテンツをダイナミックかつインタラクティブに表示するのに最適です。パッケージは軽量であり、最小限のセットアップでFlutterアプリにシームレスに統合できます。

用途

  • 製品画像の紹介
  • プロモーションバナーの表示
  • ユーザーの証言を紹介しています
  • 画像ギャラリーの作成
  • アプリ機能の強調

主な機能

  • 無限スクロール
  • カスタマイズ可能なインジケーター
  • 事前構築されたアニメーションオプション
  • 複数のプラットフォームのサポート
  • 拡張可能なデザイン
  • スムーズな遷移

適している対象

  • ECアプリ
  • マーケティングウェブサイト
  • ポートフォリオの表示
  • コンテンツ豊富なモバイルアプリ
  • インタラクティブUI

注意事項

  • 大規模データセットのパフォーマンス
  • カスタムインジケータの複雑さ
  • 低性能デバイスでのアニメーション遅延
  • 限定された組み込みスワイプジェスチャー
  • タップイベントの手動処理が必要です

元の README

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

Flutter Carousel Slider

A customizable carousel slider for flutter

pub package

Screenshots

Installing

dependencies:
  flutter_carousel_slider: ^1.1.0

Demo

Demo application available at https://flutter-carousel-slider.web.app/

Using

import 'package:flutter/material.dart';
import 'package:flutter_carousel_slider/carousel_slider.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Carousel Slider',
      home: MyHomePage(title: 'Flutter Carousel Slider'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

  MyHomePage({Key key, this.title}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final List<Color> colors = [
    Colors.red,
    Colors.orange,
    Colors.yellow,
    Colors.green,
    Colors.blue,
    Colors.indigo,
    Colors.purple,
  ];
  final List<String> letters = [
    "A",
    "B",
    "C",
    "D",
    "E",
    "F",
    "G",
  ];

  bool _isPlaying = false;
  GlobalKey<CarouselSliderState> _sliderKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListView(
        children: <Widget>[
          Container(
            height: 500,
            child: CarouselSlider.builder(
                key: _sliderKey,
                unlimitedMode: true,
                slideBuilder: (index) {
                  return Container(
                    alignment: Alignment.center,
                    color: colors[index],
                    child: Text(
                      letters[index],
                      style: TextStyle(fontSize: 200, color: Colors.white),
                    ),
                  );
                },
                slideTransform: CubeTransform(),
                slideIndicator: CircularSlideIndicator(
                  padding: EdgeInsets.only(bottom: 32),
                ),
                itemCount: colors.length),
          ),
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 32),
            child: Align(
              child: ConstrainedBox(
                constraints: BoxConstraints(minWidth: 240, maxWidth: 600),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    IconButton(
                      iconSize: 48,
                      icon: Icon(Icons.skip_previous),
                      onPressed: () {
                        _sliderKey.currentState.previousPage();
                      },
                    ),
                    IconButton(
                      iconSize: 64,
                      icon: Icon(
                        _isPlaying
                            ? Icons.pause_circle_outline
                            : Icons.play_circle_outline,
                      ),
                      onPressed: () {
                        setState(
                          () {
                            _isPlaying = !_isPlaying;
                            _sliderKey.currentState.setPlaying(_isPlaying);
                          },
                        );
                      },
                    ),
                    IconButton(
                      iconSize: 48,
                      icon: Icon(Icons.skip_next),
                      onPressed: () {
                        _sliderKey.currentState.nextPage();
                      },
                    ),
                  ],
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}

カテゴリー

ソースリポジトリ

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