Giter Site home page Giter Site logo

list_bloc's People

Contributors

adar2378 avatar ajilo297 avatar ayushin avatar jesusrp98 avatar kirill09 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

list_bloc's Issues

create pet store example

The primary goal of this library was to create a simple abstraction layer between an open API client automatically generated by https://openapi-generator.tech/docs/generators/dart-dio/ and the UI layer using BLOC architecture.

We do this internally at our company, and it would be great to have an example of how to use this library with a standard Pet Store example from

We should create an example of using ListBloc and PaginatedBloc using dart-dio api generated with https://openapi-generator.tech/

In the example we should show how to generate https://openapi-generator.tech/docs/generators/dart-dio client from the Pt Store example swagger.yaml then we should create a DataRepository and PagedRepository based on that client and finally show how to use it in a simple Flutter application that would display the pets from the Pet Store using this library.

[flutter_list_bloc] Create an example app showcasing usage of the widgets.

Create an example app for flutter_list_bloc package. It should demonstrate the usage of all the widgets available in flutter_list_bloc. Please provide in-code documentation of each widget and when to use the widget.

  • DataBlocBuilder
  • ListBlocBuilder
  • ListViewBlocBuilder
  • ContinuousScrollBuilder
  • ContinuousListViewBlocBuilder
  • PageViewBlocBuilder
  • SliverListBlocBuilder

Goals:

  • Showcase example use-case of each widget from flutter_list_bloc.
  • Write in-code documentation with the use case of the widget.
  • Example code must be plain and simple, remember to keep the structure flat and no nesting file structure.
  • It is just an example app so write minimal code to showcase the usage. No need for 3rd party packages/plugins.
  • Use DRY principle wherever applicable.
  • Bonus Task: #19

Please create a PR for review when done. Keep the commit history clean, and use atomic commit pushes.

Resources

[list_bloc] Reloading uses current offset to reload, which can return empty list

Currently reloading takes the current state's filter
Code Link

  Future<void> reload([F? filter]) => super.load(filter);
  // in data_cubit.dart
  Future<void> load([F? filter]) async {
    final f = filter ?? state.filter;
  // etc...

If the user scrolls to the last item, then after reaching the last item the ContinuousScrollBuilder will take the total item's length as the current offset and try to fetch items. As of this moment, the filter's offset value becomes the length of the items.
Code Link

      final offset = _cubit.state.data?.length ?? 0;

Then if we reload the list the cubit will return 0 items and the previously loaded items will vanish due to the wrong offset value.(This offset value is the last items offset after that no items are available to fetch)

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.