Code Monkey home page Code Monkey logo

paginable's People

Contributors

thechinkysight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

donk3ys

paginable's Issues

enhancement: let scroll notifications bubble

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!

Gridview for Paginable

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.

enhancement: use ListView.separated instead of builder

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

Confilct with carousel_slider

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.

loads forever if items less than screen height

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),

    ));
  }
}

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.