Giter VIP home page Giter VIP logo

flutter_page_indicator's Introduction

caijinglong

  • Flutter/Android developer.
  • Open source.

Caijinglong's github stats

Top Langs

Buy me coffee

flutter_page_indicator's People

Contributors

caijinglong avatar dotneet avatar gopalvirat avatar knightcube avatar milleradulu avatar patrickfallon 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flutter_page_indicator's Issues

PageIndicator stays ltr even if you change app directionality to rtl

I was trying to create an RTL app, and I needed to swipe from right to left, but the PageIndicator doesn't change to RTL as the PageView child does. I was trying to create an RTL app, and I needed to swipe from right to left, but the PageIndicator doesn't change to RTL as the PageView child does. I was trying to create an RTL app, and I needed to swipe from right to left, but the PageIndicator
doesn't change to RTL as the PageView child does.

Screen-Recording-1398-12-15-at-1

I did eventually get what I wanted by putting a directionality widget on the PageIndicator widget and also reversing the PageView widget. Still, you could add a feature to your widget for more comfortable use.

Here's the code if you wanted to use it:

                  Directionality(
                    textDirection: TextDirection.ltr,
                    child: PageIndicatorContainer(
                      child: PageView(
                        reverse: true,
                        children: productImages,
                      ),
                      length: productImages.length,
                      indicatorColor: ColorPalette.kdisabledColor,
                      indicatorSelectorColor: ColorPalette.klightPrimarySolid,
                    ),
                  ),

Center the pageController

hello, thanks first, I want ot ask you, when I use this and make it in the center it actually hide a field, what to do ?

Change indicator horizontal alignment

Hi, first of all, thanks for the library.

I wanted to request you to provide support for different horizontal alignments for the indicator. I looked into the source code and i figured out that the alignment can be altered by changing some values at the paint method of the custom painter's implementations.

Thank you in advance.

Type 'FixedScrollMetrics' is not a subtype of type 'PageMetrics'

Hello,

This seems to be a problem when using a scroll view (ListView in my case) as a PageView child and scrolling vertically (or perpendicular) to the PageView orientation.

Below is the stack trace:
I/flutter ( 4144): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════ I/flutter ( 4144): The following _TypeError was thrown while handling a gesture: I/flutter ( 4144): type 'FixedScrollMetrics' is not a subtype of type 'PageMetrics' I/flutter ( 4144): I/flutter ( 4144): When the exception was thrown, this was the stack: I/flutter ( 4144): #0 PageContainerState._onScroll (package:page_indicator/src/container.dart:114:25) I/flutter ( 4144): #1 NotificationListener._dispatch (package:flutter/src/widgets/notification_listener.dart:129:41) I/flutter ( 4144): #2 Notification.visitAncestor (package:flutter/src/widgets/notification_listener.dart:47:20) I/flutter ( 4144): #3 ViewportNotificationMixin.visitAncestor (package:flutter/src/widgets/scroll_notification.dart:31:18) I/flutter ( 4144): #4 Element.visitAncestorElements (package:flutter/src/widgets/framework.dart:3989:39) I/flutter ( 4144): #5 Notification.dispatch (package:flutter/src/widgets/notification_listener.dart:63:13) I/flutter ( 4144): #6 DragScrollActivity.dispatchScrollUpdateNotification (package:flutter/src/widgets/scroll_activity.dart:443:139) I/flutter ( 4144): #7 ScrollPosition.didUpdateScrollPositionBy (package:flutter/src/widgets/scroll_position.dart:721:14) I/flutter ( 4144): #8 ScrollPosition.setPixels (package:flutter/src/widgets/scroll_position.dart:245:9) I/flutter ( 4144): #9 ScrollPositionWithSingleContext.setPixels (package:flutter/src/widgets/scroll_position_with_single_context.dart:83:18) I/flutter ( 4144): #10 ScrollPositionWithSingleContext.applyUserOffset (package:flutter/src/widgets/scroll_position_with_single_context.dart:126:5) I/flutter ( 4144): #11 ScrollDragController.update (package:flutter/src/widgets/scroll_activity.dart:372:14) I/flutter ( 4144): #12 ScrollableState._handleDragUpdate (package:flutter/src/widgets/scrollable.dart:543:12) I/flutter ( 4144): #13 DragGestureRecognizer._checkUpdate.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:403:54) I/flutter ( 4144): #14 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) I/flutter ( 4144): #15 DragGestureRecognizer._checkUpdate (package:flutter/src/gestures/monodrag.dart:403:7) I/flutter ( 4144): #16 DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:258:9) I/flutter ( 4144): #17 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12) I/flutter ( 4144): #18 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:122:9) I/flutter ( 4144): #19 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) I/flutter ( 4144): #20 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18) I/flutter ( 4144): #21 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7) I/flutter ( 4144): #22 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) I/flutter ( 4144): #23 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) I/flutter ( 4144): #24 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) I/flutter ( 4144): #25 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) I/flutter ( 4144): #26 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) I/flutter ( 4144): #30 _invoke1 (dart:ui/hooks.dart:275:10) I/flutter ( 4144): #31 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5) I/flutter ( 4144): (elided 3 frames from dart:async) I/flutter ( 4144): I/flutter ( 4144): Handler: "onUpdate" I/flutter ( 4144): Recognizer: I/flutter ( 4144): VerticalDragGestureRecognizer#89b5b

Swipe on buttonPress

I'd like to swipe write and and left not on a button Press.
Is there a function I can trigger?

Bug(Maybe)

Hi, I am pretty new to flutter and I saw this package today and started using it. I am using it in a horizontal page view to display pictures, and I am also implementing a swipe to dismiss when swiping upwards. The problem occurs when I delete the last picture/page, the indicator doesn't refresh even though I remove the image from the list inside the setstate. The indicator will always be indicating the last image and the number of dots is always one more than the number of pictures that I have. I did set the length to the length of the list of picture and I do see that the number updates.

Wrong initial state while setting initialPage in PageController

When initialPage is set with value other than 0, page indicator still indicates page 0 before gesture events.

PageIndicatorContainer(
  pageView: PageView.builder(
    controller: PageController(initialPage: index),
    itemCount: media.length,
    itemBuilder: (context, index) => Stack(
          fit: StackFit.expand,
          children: [
            Center(child: CircularProgressIndicator()),
            FadeInImage.memoryNetwork(
                placeholder: kTransparentImage,
                image: media[index].url,
                fadeInDuration: Duration(milliseconds: 300),
                fit: BoxFit.contain),
          ],
        ),
    onPageChanged: _onPageChanged,
  ),
  length: media.length,
  padding: EdgeInsets.only(bottom: 8),
  indicatorColor: Color(0xaaaaaaaa),
  indicatorSelectorColor: Theme.of(context).accentColor,
  size: 8,
),

TabContoller inside pageview causes indicator to change index.

Inside a PageIndicator I have a PageView which hosts a DefaultTabcontroller with 2 tabs.

If i change the active tab index inside the page a ScrollNotification with depth = 1 will be send to the _onScroll method in the PageIndicator causing incorrect behavior (cause the tab is changed not the page in the PageView)

if i change the index of the PageView a ScrollNotificaiton with depth = 0 will be send to the _onScroll method in the PageIndicator

Typically a ScrollNotification Listener should respond to a scrollnotification with depth of only 0,

could this be changed?

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.