- Flutter/Android developer.
- Open source.
caijinglong / flutter_page_indicator Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
How to change the page dot size?
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.
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,
),
),
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 ?
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.
Nice job, I hope that your next version dealing with a reverse attribute in PageView.
Thank you.
Hi,
I want to trigger an event if I swipe in a direction and I am at the end of the content array.
E.g. a pop up that sais "there are no more pages to swipe to".
the onPageChange doesn't trigger in this case.
Thank you
How to change the page dot size?
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
Below link is image that is captured on flutter plugin site.
captured image
import 'package:page_view_indicator/page_view_indicator.dart';
is incorrect!.
change to import 'package:page_indicator/page_indicator.dart';
Best Regards.
I'd like to swipe write and and left not on a button Press.
Is there a function I can trigger?
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.
https://gfycat.com/ko/fewdearestfairybluebird
I hope a very normal moving option like this.
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,
),
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.