thechinkysight / paginable Goto Github PK
View Code? Open in Web Editor NEWA Flutter package which makes pagination easier.
Home Page: https://pub.dev/packages/paginable
License: BSD 3-Clause "New" or "Revised" License
A Flutter package which makes pagination easier.
Home Page: https://pub.dev/packages/paginable
License: BSD 3-Clause "New" or "Revised" License
Currently the onNotification
callback returns true
, making ancestor unable to tap into scroll events.
onNotification: (ScrollUpdateNotification scrollUpdateNotification) {
if (isAlmostAtTheEndOfTheScroll(scrollUpdateNotification) &&
isScrollingDownwards(scrollUpdateNotification)) {
if (!isLoadMoreBeingCalled) {
performPagination();
}
}
return true;
},
I have a widget which conditionally elevates the AppBar
when the content is scrolled. But it does not work with PaginableListViewBuilder
.
Sorry for not making a PR. I made one but could not push branch :D
Thanks for the package!
Is your feature request related to a problem? Please describe.
This is a feature request and not due to an issue.
Describe the solution you'd like
I was wondering if you were thinking about adding a grid-view implementation for the paginable package where each row would consist of 2 items next to each other for a more compact view. Preferably a sliver grid implementation.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
By changing from builder
to separated
the properties semanticChildCount
and itemExtent
would be lost in favor of separatorBuilder
. (Although, I do not really see why these props are missing from the separated
ctor..)
Thanks
Describe the bug
When sliding through a carousel from the carousel_slider package the loadMore function gets called from paginable.
Not sure how the two are conflicting or if there is a work around.
To Reproduce
class TestError extends StatelessWidget {
final List<List<Color>> itemList = [
[Colors.black87, Colors.black54],
[Colors.white38, Colors.white54],
[Colors.red, Colors.redAccent],
[Colors.blue, Colors.blueAccent],
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: PaginableCustomScrollView(
loadMore: () async => print("CALLED LOAD MORE"), // THIS SHOULD NOT GET CALLED WHEN SCROLLING CAROUSEL
slivers: [
SliverList(
delegate: PaginableSliverChildBuilderDelegate(
(context, index) {
final item = itemList.elementAt(index);
return CarouselSlider(
options: CarouselOptions(
height: MediaQuery.of(context).size.height * 0.5,
enableInfiniteScroll: false,
),
items: item
.map(
(clr) => Container(
color: clr,
child: const Center(child: Text("< Swipe >")),
),
)
.toList(),
);
},
childCount: itemList.length,
errorIndicatorWidget: (exception, tryAgain) =>
PaginationErrorWifdget(
exception: exception,
tryAgain: tryAgain,
),
progressIndicatorWidget: const PaginationLoadingWidget(),
).build(),
),
],
),
);
}
}
Run code above and read console output
Additional context
Not sure if this even affects your package but just though id let you know in case you have an easy workaround.
nice library, almost.
If the list is short (eg 5 items) it will show progressIndicator forever.
eg
import 'package:flutter/material.dart';
import 'package:paginable/paginable.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Scaffold(body: PaginableListViewBuilder(
loadMore: () async {},
errorIndicatorWidget: (exception, tryAgain) => Container(
color: Colors.redAccent,
height: 130,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
exception.toString(),
style: const TextStyle(fontSize: 16),
),
const SizedBox(
height: 16.0,
),
ElevatedButton(
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(Colors.green),
),
onPressed: tryAgain,
child: const Text('Try Again'),
),
],
),
),
progressIndicatorWidget: const SizedBox(
height: 20,
child: Center(
child: CircularProgressIndicator(),
),
),
itemBuilder: (context, index) => ListTile(
leading: CircleAvatar(
child: Text(
index.toString(),
),
),
),
itemCount: 5),
));
}
}
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.