Coder Social home page Coder Social logo

eliezerantonio / flutter_carousel_intro Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 13.0 27.24 MB

Home Page: https://pub.dev/packages/flutter_carousel_intro

License: MIT License

Dart 65.14% Kotlin 0.11% Swift 0.91% Objective-C 0.03% CMake 14.74% C++ 16.49% C 1.12% HTML 1.45%
carousel-slider dart flutter widget hacktoberfest carousel onboarding onboarding-screen

flutter_carousel_intro's Introduction

English | Português

flutter_carousel_intro

by: Eliezer António

see in Flutter Gems: https://fluttergems.dev/packages/flutter_carousel_intro

Swipe the carousel to the current clicked indicator

Current Features

  • Custom child widgets
  • Slide
  • Rotate transition
  • Auto play
  • Horizontal transition
  • Vertical transition
  • Swipe the carousel to the current clicked indicator

Features to be implemented

  • Repeat
  • Forward button & Back button (isn't very important)

Supported Platforms

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

Preview

Installation

Add flutter_carousel_intro: ^1.0.11 to your pubspec.yaml dependencies. And import it:

import 'package:flutter_carousel_intro/flutter_carousel_intro.dart';

How to use

FlutterCarouselIntro(  
       slides: [
          SliderItem(
            title: 'Title 1',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-1.svg"),
          ),
          SliderItem(
            title: 'Title 2',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-2.svg"),
          ),
          SliderItem(
            title: 'Title 3',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-3.svg"),
          ),
          SliderItem(
            title: 'Title 4',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-4.svg"),
          ),
          SliderItem(
            title: 'Title 5',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-5.svg"),
          ),
          SliderItem(
            title: 'Title 5',
            widget: SvgPicture.asset("assets/slide-6.svg"),
            subtitle: ElevatedButton(
              onPressed: () {},
              child: const Text("skip"),
            ),
          ),
        ],
    );

All SliderItem parameters

  String? title,
  TextStyle? titleTextStyle,
  TextAlign? titleTextAlign,
  Widget? subtitle,
  

General Example

class MySlideShow extends StatelessWidget {
  const MySlideShow({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return FlutterCarouselIntro(
        animatedRotateX: false,
        animatedRotateZ: true,
        scale: true,
        autoPlay: true,
        animatedOpacity: false,
        autoPlaySlideDuration: const Duration(seconds: 2),
        autoPlaySlideDurationTransition: const Duration(milliseconds: 1100),
        primaryColor: Colors.pink,
        secondaryColor: Colors.grey,
        scrollDirection: Axis.horizontal,
        indicatorAlign: IndicatorAlign.bottom,
        indicatorEffect: IndicatorEffects.jumping,
        showIndicators: true,
         slides: [
          SliderItem(
            title: 'Title 1',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-1.svg"),
          ),
          SliderItem(
            title: 'Title 2',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-2.svg"),
          ),
          SliderItem(
            title: 'Title 3',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-3.svg"),
          ),
          SliderItem(
            title: 'Title 4',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-4.svg"),
          ),
          SliderItem(
            title: 'Title 5',
            subtitle: const Text('Lorem Ipsum is simply dummy text'),
            widget: SvgPicture.asset("assets/slide-5.svg"),
          ),
          SliderItem(
            title: 'Title 5',
            widget: SvgPicture.asset("assets/slide-6.svg"),
            subtitle: ElevatedButton(
              onPressed: () {},
              child: const Text("skip"),
            ),
          ),
        ],
      );
  }
}

Gif

Normal Example:

Animated Opacity

normal

animatedOpacity: true

Animated Scale

scale: true

Animated Rotation on the X Axis

animatedRotateX: true

Animated Rotation on the Z Axis

animatedRotateZ: true

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

My Packages

Flutter Responsivity Widget

flutter_carousel_intro's People

Contributors

adilsontchameia avatar antonio-nicolau avatar antonio-pedro99 avatar eliezerantonio avatar elisiomassaqui avatar henriquesilva20 avatar ildysilva avatar jacob-dvlp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_carousel_intro's Issues

Slides direction

Hi @eliezerantonio
once again, you have done a nice work. However, I was wondering if it would not be good if we could have vertical and horizontal slides.

custom indicators when?

It should also be good if we could add our own indicators instead of using dots all the time.

SafeArea is a low level configuration.

I do not think you should use SafeArea in FlutterCarouselIntro as the child of ChangeNotifierProvider.
E.g, I want my slides to occupy the full screen, but I can not because the FlutterCarouselIntro is preventing the slides to occupy the whole screen.

Swipe the carousel to the current clicked indicator

Currently is only possible to slide the carousel by swipe the page, it brings a limitation: we cannot jump from last item to first one or first to third. We have a linear behaviour
Would be nice to also Swipe the carousel by click on indicators, this way we overcome this limitation

This way we would have two behaviour:

  1. Change the carousel position by Swiping
  2. Change the carousel position by click on indicators

Add Skip Button

Add a Skipp button on top left for go straight to the last slide.

toggle Indicators, Hide or Show

now for show the indicators should be optional, but by default should show the indicators

the property name: showsIndicators

Auto Play

An autoplay functionality would be good enough for an extra experience.

It could has a boolean option, so it would be up to user enable it or no.

pointsAbove is not a good parameter name to refer to the position of the indicators

I know points might come from Portuguese, which literally means dots, but here it gives the feeling that we want to point something above something.

I think a good name for this parameter should be

  • indicatorsAlignment
  • indicatorsTop

and more, what if instead of bool use enum to indicate the direction/Alignment of the indicators?
Something like
enum DotsPosition { top, bottom }
or IndicatorsPostion { top, bottom }

Add a better description

Hi @eliezerantonio

You have done such an amazing package, congrats for making it.

It would be nice to have more details about the package here on Github and on pub.dev!

Wishing you all the best!

Error: Could not find the correct Provider<SliderModel> above this FlutterCarouselIntro Widget

Currently there's an issue where is necessary add ChangeNotifierProvider to the example project to be able to run the package locally while in development process.

I suggest to change Provider to Riverpod to avoid those kind of Provider not foundexceptions

How to reproduce:

  1. Go to pubspec.yaml
  2. Change flutter_carousel_intro to be loaded from local instead of pub.dev
  3. Run the project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.