패키지, 저장소 및 앱 카테고리 검색

flutter_custom_carousel_slider 표지
패키지 상세v1.2.0

flutter_custom_carousel_slider

뉴스 및 블로그에 적합한 사용자 정의 장식을 지원하는 카라셀 슬라이더 위젯입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
50
좋아요
36
Pub 점수
150

패키지 설치

flutter pub add flutter_custom_carousel_slider

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

뉴스 및 블로그 콘텐츠를 표시하기 위해 설계된 사용자 정의 가능한 카루셀 슬라이더 위젯으로, 유연한 장식 옵션을 제공합니다. Flutter용으로 제작되었으며 Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 개발자가 맞춤형 외관과 동작을 갖춘 시각적으로 매력적이고 상호작용 가능한 슬라이더를 만들 수 있도록 합니다. 주목할 만한 기사, 제품 강조, 또는 동적 콘텐츠를 스크롤 가능한 형식으로 소개하는 데 이상적입니다. 가볍고 기존 Flutter 프로젝트에 원활하게 통합됩니다.

사용 사례

  • 추천 뉴스 기사 표시
  • 블로그 게시물 전시
  • 제품 프로모션 강조
  • 인터랙티브 콘텐츠 카루셀 만들기
  • 사용자 정의 스타일로 이미지 갤러리 표시

주요 기능

  • 사용자 정의 가능한 슬라이드 장식
  • 다중 플랫폼 지원
  • Flutter와의 간편한 통합
  • 반응형 디자인 기능
  • 스무스 스크롤 애니메이션
  • 사용자 정의 가능한 슬라이드 전환 효과

적합한 대상

  • 뉴스 및 블로그 애플리케이션
  • 전자상거래 제품 전시
  • 콘텐츠가 풍부한 모바일 및 웹 앱
  • 인터랙티브 UI 컴포넌트
  • 시각적 유연성을 찾는 디자이너

고려 사항

  • 슬라이드 데이터 관리에 대한 수동 처리 필요
  • 기본 스와이프 외에 내장된 제스처 컨트롤이 제한적
  • 복잡한 사용 사례를 위해 추가 상태 관리가 필요할 수 있습니다
  • 페이지네이션 없이 매우 큰 데이터 세트에 최적화되지 않음
  • 고급 기능을 위해 외부 종속성에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Developer Challenge

flutter_custom_carousel_slider

A carousel slider Flutter widget, supports custom decoration suitable for news and blog.

Table of contents

Demo

Supported Platforms

  • Flutter Android
  • Flutter iOS
  • Flutter web
  • Flutter desktop

Installation

dependencies:
  flutter_custom_carousel_slider: ^1.0.0

Using

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Custom Carousel Slider Demo'),
      debugShowCheckedModeBanner: false,
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  List<CarouselItem> itemList = [
    CarouselItem(
      image: const NetworkImage(
        'https://miro.medium.com/max/1400/1*RpaR1pTpRa0PUdNdfv4njA.png',
      ),
      boxDecoration: BoxDecoration(
        gradient: LinearGradient(
          begin: FractionalOffset.bottomCenter,
          end: FractionalOffset.topCenter,
          colors: [
            Colors.blueAccent.withOpacity(1),
            Colors.black.withOpacity(.3),
          ],
          stops: const [0.0, 1.0],
        ),
      ),
      title:
          'Push your creativity to its limits by reimagining this classic puzzle!',
      titleTextStyle: const TextStyle(
        fontSize: 12,
        color: Colors.white,
      ),
      leftSubtitle: '\$51,046 in prizes',
      rightSubtitle: '4882 participants',
      rightSubtitleTextStyle: const TextStyle(
        fontSize: 12,
        color: Colors.black,
      ),
      onImageTap: (i) {},
    ),
    CarouselItem(
      image: const NetworkImage(
        'https://pbs.twimg.com/profile_banners/1444928438331224069/1633448972/600x200',
      ),
      title: '@coskuncay published flutter_custom_carousel_slider!',
      titleTextStyle: const TextStyle(
        fontSize: 12,
        color: Colors.white,
      ),
      leftSubtitle: '11 Feb 2022',
      rightSubtitle: 'v1.0.0',
      onImageTap: (i) {},
    ),
  ];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            children: [
              const SizedBox(height: 20),
              Column(
                children: [
                  const Text('Custom BoxDecoration and Autoplay'),
                  CustomCarouselSlider(
                    items: itemList,
                    height: 150,
                    subHeight: 50,
                    width: MediaQuery.of(context).size.width * .9,
                    autoplay: true,
                  ),
                ],
              ),
              const SizedBox(height: 20),
              Column(
                children: [
                  const Text('Show Only Customize Indicators'),
                  CustomCarouselSlider(
                    items: itemList,
                    height: 150,
                    subHeight: 50,
                    width: MediaQuery.of(context).size.width * .9,
                    autoplay: false,
                    showText: false,
                    showSubBackground: false,
                    indicatorShape: BoxShape.rectangle,
                    selectedDotColor: Colors.red,
                    unselectedDotColor: Colors.white,
                  ),
                ],
              ),
              const SizedBox(height: 20),
              Column(
                children: [
                  const Text('Show only images and Autoplay'),
                  CustomCarouselSlider(
                    items: itemList,
                    height: 150,
                    subHeight: 50,
                    width: MediaQuery.of(context).size.width * .9,
                    autoplay: true,
                    showSubBackground: false,
                    showIndicator: false,
                    showText: false,
                  ),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

CustomCarouselSlider

Name Type Default
items List *required
height double 200.0
subHeight double height*.4
width double 200.0
showIndicator bool true
showSubBackground bool true
showText bool true
autoplay bool true
animationCurve Curve Curves.ease
animationDuration Duration 300ms
autoplayDuration Duration 3s
indicatorShape BoxShape BoxShape.circle
dotSpacing double 5.0
selectedDotColor Color Colors.white
selectedDotHeight double 8.0
selectedDotWidth double 8.0
unselectedDotColor Color Color(0XFFACAEBA)
unselectedDotHeight double 6.0
unselectedDotWidth double 6.0
boxPaddingHorizontal double 10.0
boxPaddingVertical double 2.0

CarouselItem

Name Type
image NetworkImage
title String
titleTextStyle TextStyle
leftSubtitle String
leftSubtitleTextStyle TextStyle
rightSubtitle String
rightSubtitleTextStyle TextStyle
onImageTap Function(int)
boxDecoration BoxDecoration

License

MIT Copyright (c) 2022, Emre Coşkunçay

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.