搜索分类、插件与代码仓

overlapped_carousel 封面
插件详情v1.0.2

overlapped_carousel

一个 Flutter 包项目,包含一个简单的水平重叠轮播图小部件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
616
喜欢数
75
Pub 分数
140

安装插件

flutter pub add overlapped_carousel

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,提供了一个简单的水平重叠轮播图组件,非常适合展示具有视觉吸引力的重叠效果的项目。它支持流畅滚动,并专为需要动态、交互式卡片布局的应用程序设计。该组件轻量且兼容所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。非常适合以现代、引人入胜的方式展示图片、产品或内容。

适合场景

  • 显示图像画廊
  • 展示产品卡片
  • 创建交互式滑块
  • 展示精选内容
  • 构建现代 UI 布局

主要特点

  • 水平重叠布局
  • 平滑滚动交互
  • 跨平台兼容性
  • 轻量级实现
  • 可自定义的项目间距
  • 通过 pub add 简单集成

适合对象

  • 移动应用开发者
  • Web应用程序设计师
  • UI/UX创作者
  • 电子商务界面
  • 交互式内容显示

使用建议

  • 限制为横向方向
  • 无内置分页控件
  • 需要手动处理项目选择
  • 未针对大型数据集进行优化
  • 除了间距和对齐之外,自定义选项很少

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Overlapped Carousel

A horizontal overlapped carousel widget. The center widget will be at the top of the stack.

Demo

Demo 1 Demo 2
demo 1 demo 2

Installation

Add overlapped_carousel: ^1.1.0 to your pubspec.yaml dependencies. And import it:

import 'package:overlapped_carousel/overlapped_carousel.dart';

How to use

Simply add a OverlappedCarousel widget with required params.

  @override
  Widget build(BuildContext context) {
    var screenWidth = MediaQuery.of(context).size.width;
    var screenHeight = MediaQuery.of(context).size.height;
    return Scaffold(
      backgroundColor: Colors.blue,
      //Wrap with Center to place the carousel center of the screen
      body: Center(
        //Wrap the OverlappedCarousel widget with SizedBox to fix a height. No need to specify width.
        child: SizedBox(
          height: min(screenWidth / 3.3 * (16 / 9),screenHeight*.9),
          child: OverlappedCarousel(
            widgets: widgets, //List of widgets
            currentIndex: 2,
            onClicked: (index) {
              ScaffoldMessenger.of(context).showSnackBar(
                SnackBar(
                  content: Text("You clicked at $index"),
                ),
              );
            },
            // To obscure or blur cards not in focus use the obscure parameter.
            obscure: 0.4,
            // To control skew angle
            skewAngle: 0.25,
          ),
        ),
      ),
    );
  }

所属分类

源码仓库

使用此插件的项目

暂无相关数据。