PageIndicator like Instagram written for Flutter

Overview

pub package

scrolling_page_indicator

View page indicator like Instagram

preview

Getting Started

  1. Dependency
dependencies:
  scrolling_page_indicator: ^0.1.2
  1. Install

flutter packages get

  1. Import
import 'package:scrolling_page_indicator/scrolling_page_indicator.dart';
  1. Use
ScrollingPageIndicator(
    dotColor: Colors.grey,
    dotSelectedColor: Colors.deepPurple,
    dotSize: 6,
    dotSelectedSize: 8,
    dotSpacing: 12,
    controller: _controller,
    itemCount: items.length,
    orientation: Axis.horizontal
)
Comments
  • Change Animation Direction

    Change Animation Direction

    Dear Nikita

    Firstly Thank you for this awesome package. Secondly Is there a way to change the direction of the indicator animation from LTR to RTL ??

    opened by YoussefGheith 4
  • [Feature Request] Add labels

    [Feature Request] Add labels

    Hi, my design calls for labels to appear briefly when a new page is chosen. Is that something that's easy to add? Fade in for a specified duration before disappearing. Thanks!

    opened by ThinkDigitalSoftware 4
  • BoxConstraints has a negative minimum height.

    BoxConstraints has a negative minimum height.

    When the exception was thrown, this was the stack: #0 BoxConstraints.debugAssertIsValid..throwError (package:flutter/src/rendering/box.dart:510:9) #1 BoxConstraints.debugAssertIsValid. (package:flutter/src/rendering/box.dart:541:19) #2 BoxConstraints.debugAssertIsValid (package:flutter/src/rendering/box.dart:558:6) #3 new RenderConstrainedBox (package:flutter/src/rendering/proxy_box.dart:196:37) #4 SizedBox.createRenderObject (package:flutter/src/widgets/basic.dart:2077:12)

    This is thrown with the following code.

    Stack(
                children: <Widget>[
                  SizedBox.expand(
                    child: PageView(
                      controller: _pageController,
                      scrollDirection: Axis.vertical,
                      children: state.pages,
                    ),
                  ),
                  Positioned(
                    right: 10,
                    child: ScrollingPageIndicator(
                      orientation: Axis.vertical,
                      itemCount: state.pages.length, // which is 0 currently
                      controller: _pageController,
                    ),
                  )
                ],
              );
    
    opened by ThinkDigitalSoftware 2
  • Issue with dots count

    Issue with dots count

    Hi... I tried to use your widget as you suggested, but I get 34 dots, no matter what's itemCount value is

    @override
      Widget build(BuildContext context) {
        return Padding(
          padding: const EdgeInsets.only(top: 16.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                      Padding(
                        padding: const EdgeInsets.only(right: 8.0, left: 8.0),
                        child: CircleAvatar(
                          radius: 23,
                          child: CachedNetworkImage(
                            imageUrl: widget.post.owner.profilePicture,
                          ),
                        ),
                      ),
                      Text(widget.post.owner.name),
                    ],
                  ),
                  IconButton(
                    icon: Icon(Icons.more_vert),
                    onPressed: null,
                  )
                ],
              ),
              Padding(
                padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
                child: AspectRatio(
                  aspectRatio: widget.post.items[_currentPage].ratio,
                  child: Stack(
                    children: [
                      Positioned.fill(
                        child: PageView.builder(
                          onPageChanged: _onPageChanged,
                          controller: _pageController,
                          itemCount: widget.post.items?.length ?? 0,
                          itemBuilder: (context, index) {
                            return _buildPostItemViewHolder(index);
                          },
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              ScrollingPageIndicator(
                dotColor: Colors.grey,
                dotSelectedColor: Colors.deepPurple,
                dotSize: 6,
                dotSelectedSize: 8,
                dotSpacing: 12,
                controller: _pageController,
                itemCount: widget.post.items.length,
                orientation: Axis.horizontal,
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      IconButton(
                        alignment: Alignment.center,
                        padding: EdgeInsets.all(0),
                        icon: Icon(Icons.favorite_border),
                        onPressed: null,
                      ),
                      IconButton(
                        alignment: Alignment.center,
                        padding: EdgeInsets.all(0),
                        icon: Icon(Icons.comment),
                        onPressed: null,
                      ),
                      IconButton(
                        padding: EdgeInsets.all(0),
                        icon: Icon(Icons.send),
                        onPressed: null,
                      ),
                    ],
                  ),
                  IconButton(
                    icon: Icon(Icons.bookmark_border),
                  ),
                ],
              ),
            ],
          ),
        );
      }
    

    I even tried to set a exact value to itemCount like itemCount: 2 but get same result everytime Screenshot_20191007-164657

    opened by k2evil 1
  • [Bug] No animation when page swiper is looping

    [Bug] No animation when page swiper is looping

    When the swiper is set to loop the pages (either manually or automatically) the dots will not have the correct fade animation from the last page to the first. The last dot will fade out but the first dot will not fade in.

    I'm using it together with https://pub.dev/packages/flutter_swiper

    bug_looping.mov.zip

    Change these file in the example directory to get a test with a looping flutter_swiper demo: swiper_example.zip

    opened by mploigt 1
  • Make certain fields required

    Make certain fields required

    Hey, it's not a big deal, but it would help if the fields that can't be null are required so we don't have to find out about errors at runtime. Suggested edits:

     ScrollingPageIndicator({
        Key key,
        @required this.itemCount,
        @required this.controller,
        this.dotSize: 6.0,
        this.dotSelectedSize = 10.0,
        this.dotColor: Colors.grey,
        this.dotSelectedColor = Colors.blueGrey,
        this.dotSpacing = 12.0,
        this.visibleDotCount = 5,
        this.visibleDotThreshold = 2,
        this.orientation = Axis.horizontal
      })
          : assert(itemCount != null),
            assert(controller != null),
            assert(visibleDotCount % 2 != 0),
            super(key: key);
    
    opened by ThinkDigitalSoftware 0
Owner
Android Developer
null
Flutter tinder like cards

TCard Tinder like cards. TCard Install Usage Normal widget Network image Use a controller to control Determine the sliding direction Reset with new ca

Bruno Jurković 132 Dec 9, 2022
A reactive key-value store for Flutter projects. Like shared_preferences, but with Streams.

streaming_shared_preferences A reactive key-value store for Flutter projects. streaming_shared_preferences adds reactive functionality on top of share

Iiro Krankka 244 Dec 22, 2022
A Flutter package to custom splash screen like change logo icon, logo animation, and splash screen background color.

Custom Splash Screen A Flutter package to custom splash screen: change logo icon, logo animation, and splash screen background color. (Custom from ani

tranhuycong 78 Sep 6, 2022
Flutter fluid slider - A fluid design slider that works just like the Slider material widget

Fluid Slider for Flutter Inspired by a dribbble by Virgil Pana. A fluid design s

Jay Raj 2 Feb 18, 2022
Widgets for creating Hero-like animations between two widgets within the same screen.

flutter_sidekick Widgets for creating Hero-like animations between two widgets within the same screen. Features Hero-like animations. Allow you to spe

Romain Rastel 291 Oct 21, 2022
🚅Flutter out-of-the-box collection animations written in pure dart.

LoadingIndicator A collection of out of the box loading animations written in pure dart, no extra dependency, inspired by loaders.css and NVActivityIn

Tino 170 Jan 1, 2023
A simple login UI written in flutter

login_ui A simple Flutter login ui. Sign in screen Sign up screen

Mohammad Saleh 7 Nov 2, 2022
🔔 A flutter package to create cool and beautiful text animations. [Flutter Favorite Package]

Animated Text Kit A flutter package which contains a collection of some cool and awesome text animations. Recommended package for text animations in C

Ayush Agarwal 1.4k Jan 6, 2023
This repository demonstrates use of various widgets in flutter and tricks to create beautiful UI elements in flutter for Android and IOS

AwesomeFlutterUI The purpose of this repository is to demonstrate the use of different widgets and tricks in flutter and how to use them in your proje

Subir Chakraborty 132 Nov 13, 2022
This is a Flutter URL preview plugin for Flutter that previews the content of a URL

flutter_link_preview This is a URL preview plugin that previews the content of a URL Language: English | 中文简体 Special feature Use multi-processing to

yung 67 Nov 2, 2022
Flutter liquid swipe - Liquid Swipe Animation Built With Flutter

Flutter Liquid Swipe liquid Swipe animation is amazing and its Created for iOS P

Jahongir Anvarov 6 Dec 1, 2022
A candy sorter game made with Flutter for the march flutter challenge.

A candy sorter game made with Flutter for the march flutter challenge.

Debjeet Das 1 Apr 9, 2022
✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.

✨ Flutter Spinkit A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit. ?? Installing dependencies:

Jeremiah Ogbomo 2.7k Dec 30, 2022
A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).

drawing_animation From static SVG assets See more examples in the showcasing app. Dynamically created from Path objects which are animated over time m

null 442 Dec 27, 2022
Flutter package for creating awesome animations.

?? Simple Animations Simple Animations is a powerful package to create beautiful custom animations in no time. ?? fully tested ?? well documented ?? e

Felix Blaschke 879 Dec 31, 2022
Fun canvas animations in Flutter based on time and math functions.

funvas Flutter package that allows creating canvas animations based on time and math (mostly trigonometric) functions. The name "funvas" is based on F

null 472 Jan 9, 2023
A flutter package that adds support for vector data based animations.

animated_vector Description and inspiration A package that adds support for vector data based animations. The data format is heavily inspired from the

Potato Open Sauce Project 6 Apr 26, 2022
Flutter UI Challenges

Introduction ?? Zoo is a small, simple and beautiful app that lists 3d model of animals. Before we start, you can take a look at the app: Usage ?? To

Sanjeev Madhav 58 Dec 22, 2022
A Flutter app with flip animation to view profiles of friends. 🌟

Flip View Made with ?? in India This flutter app is based on the design made Dmytro Prudnikov for Yalantis on Dribble.He describes the design as: Just

Shubham Soni 68 Sep 23, 2022