Wayaer / fl_scroll_view

fl_scroll_view encapsulates and extends easy_refresh and flutter_staggered_grid_view.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fl_scroll_view

ScrollList.count

Widget build(BuildContext context) {
  return ScrollList.count(
      header: const Header(),
      footer: const Footer(),
      padding: const EdgeInsets.all(10),
      maxCrossAxisExtent: 100,
      crossAxisCount: 3,
      mainAxisSpacing: 10,
      crossAxisSpacing: 10,
      gridStyle: GridStyle.masonry,
      refreshConfig: RefreshConfig(
          onRefresh: () async {
            debugPrint('onRefresh');
            await Future.delayed(const Duration(seconds: 2), () {
              RefreshControllers().call(EasyRefreshType.refreshSuccess);
            });
          }, onLoading: () async {
        debugPrint('onLoading');
        await Future.delayed(const Duration(seconds: 2), () {
          RefreshControllers().call(EasyRefreshType.loadingSuccess);
        });
      }),
      children: []);
}

ScrollList.builder

Widget build(BuildContext context) {
  return ScrollList.builder(
      header: const Header(),
      footer: const Footer(),
      maxCrossAxisExtent: 100,
      crossAxisCount: 3,
      mainAxisSpacing: 10,
      crossAxisSpacing: 10,
      gridStyle: GridStyle.masonry,
      separatorBuilder: (_, int index) => Divider(),
      refreshConfig: RefreshConfig(
          onRefresh: () async {
            debugPrint('onRefresh');
            await Future.delayed(const Duration(seconds: 2), () {
              RefreshControllers().call(EasyRefreshType.refreshSuccess);
            });
          }, onLoading: () async {
        debugPrint('onLoading');
        await Future.delayed(const Duration(seconds: 2), () {
          RefreshControllers().call(EasyRefreshType.loadingSuccess);
        });
      }),
      children: []);
}

Sliver

Widget build(BuildContext context) {
  return RefreshScrollView(
      controller: scrollController,
      refreshConfig: RefreshConfig(
          onRefresh: () async {
            debugPrint('onRefresh');
            await Future.delayed(const Duration(seconds: 2), () {
              RefreshControllers().call(EasyRefreshType.refreshSuccess);
            });
          }, onLoading: () async {
        debugPrint('onLoading');
        await Future.delayed(const Duration(seconds: 2), () {
          RefreshControllers().call(EasyRefreshType.loadingSuccess);
        });
      }),
      slivers: [
        FlSliverPersistentHeader(
            pinned: true,
            floating: false,
            child: Container(
                color: colorList[9],
                alignment: Alignment.center,
                child: const Text('FlSliverPersistentHeader',
                    style: TextStyle(color: Colors.black)))),
        SliverListGrid.builder(
            itemCount: colorList.length,
            maxCrossAxisExtent: 100,
            crossAxisCount: 3,
            mainAxisSpacing: 10,
            crossAxisSpacing: 10,
            gridStyle: GridStyle.masonry,
            separatorBuilder: (_, int index) {
              return Text('s$index');
            },
            itemBuilder: (_, int index) {
              return ColorEntry(index, colorList[index]);
            }),
        SliverListGrid.count(
            maxCrossAxisExtent: 100,
            crossAxisCount: 3,
            mainAxisSpacing: 10,
            crossAxisSpacing: 10,
            gridStyle: GridStyle.masonry,
            children: [
            ]),
      ]);
}

About

fl_scroll_view encapsulates and extends easy_refresh and flutter_staggered_grid_view.

License:MIT License


Languages

Language:Dart 99.9%Language:JavaScript 0.0%Language:Ruby 0.0%Language:Shell 0.0%Language:Kotlin 0.0%