loadinglistview 0.0.2

Flutter Android iOS web

Flutter ListView and GridView that shows Loading Widgets before the real data is loaded.

loadinglistview #

This package provide an easy way to show loading indicator(Widget) in a listview or a gridview while the app is still fetching the real data. Once the real data is fetched, the loading indicators are replaced with the actual data.

How it works #

  1. Provide a Future<List<T>>
  2. Provide a function that takes T and returns a widget
  3. Provide a loading widget

As regards the loading widget, there are two predefined highly customizable widgets that should work for most use cases. In case non of this two works for your use case, feel free to supply your custom widget

  1. ListTileLoadingStyle
  2. GridLoadingStyle

check the example folder to see how all these are connected together.

Basic Usage #

Given that loadPersons() return Future<List<Person>> and singlePersonWidget is of type Widget ContentWidget<T>(T data)

 LoadingListView(
        futureData: loadPersons(),
        contentWidget: singlePersonWidget,
        loadingWidget: ListTileLoadingStyle(),
      )
  LoadingGridView(
        futureData: loadPersons(),
        contentWidget: singlePersonWidget,
        loadingWidget: GridLoadingStyle(),
      )

More customized loading widget

  ListTileLoadingStyle(
        leadingShape: BoxShape.rectangle,
        leadingSize: 70,
        titleWidth: 150,
        subtitleWidth: 120,
        titleBorderRadius: 0,
        subtitleBorderRadius: 0,
      )

With shimmering effect

If you want a shimmering effect on the loading widget consider wrapping SkeletonAnimation around it.

License #

This package is licensed under the MIT license. See LICENSE for details.

4
likes
100
pub points
61%
popularity

Flutter ListView and GridView that shows Loading Widgets before the real data is loaded.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

michaeladesola1410@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on loadinglistview