Example project for sticky infinite list

Overview
You might also like...

This project is about the Textfield and TextFormField validation authorized by kabir

login_validation A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you sta

Nov 27, 2021

A Flutter project for login and sign up

A Flutter project for login and sign up

loginsignup A new Flutter project for login and sign up. Getting Started This project is a starting point for a Flutter application. A few resources t

Dec 27, 2022

A flutter project with Implementation of a Contacts app in 4 ways (API, Custom, Preferences and Sqflite).

A flutter project with Implementation of a Contacts app in 4 ways (API, Custom, Preferences and Sqflite).

Contacts A flutter project with Implementation of a Contacts app in 4 ways (API, Custom, Preferences and Sqflite). It consist some common operations l

Nov 20, 2022

A Flutter Login Page UI project

A Flutter Login Page UI project

flutter_login_ui A new Flutter Login Page UI project. Getting Started This project is a starting point for a Flutter application. A few resources to g

Dec 4, 2021

Load and get full control of your Rive files in a Flutter project using this library.

Load and get full control of your Rive files in a Flutter project using this library.

⚠️ Please migrate to the new Rive Flutter runtime. This runtime is for the old Rive (formerly Flare) and will only receive updates for breaking issues

Dec 31, 2022

A signin/login project with Flutter and Firebase

A signin/login project with Flutter and Firebase

SignIn_Firebase This is a signin/login project.Here some of screenshot in my pro

Dec 19, 2021

Shimmer loading - A Flutter project to show how to add shimmer loading animation

Shimmer loading - A Flutter project to show how to add shimmer loading animation

shimmer_loading A Flutter project to show how to add shimmer loading animation.

Feb 6, 2022

Multi directional infinite list with Sticky headers for Flutter applications

Multi directional infinite list with Sticky headers for Flutter applications

Sticky Infinite List Infinite list with sticky headers. This package was made in order to make possible render infinite list in both directions with s

Dec 20, 2022

Multi directional infinite list with Sticky headers for Flutter applications

Multi directional infinite list with Sticky headers for Flutter applications

Sticky Infinite List Infinite list with sticky headers. This package was made in order to make possible render infinite list in both directions with s

Dec 20, 2022

Flutter Sticky Headers - Lets you place "sticky headers" into any scrollable content in your Flutter app. No special wrappers or magic required. Maintainer: @slightfoot

Flutter Sticky Headers - Lets you place

Flutter Sticky Headers Lets you place headers on scrollable content that will stick to the top of the container whilst the content is scrolled. Usage

Jan 4, 2023

Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

sticky_and_expandable_list Flutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView. README i18n:中文说明 Feature

Nov 16, 2022

Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map.

Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map.

Custom Radio Group List Flutter package to create list of radio button, by providing a list of objects it can be a String list or list of Map. Feature

Nov 30, 2021

A Very Good Infinite List Widget created by Very Good Ventures. Great for activity feeds, news feeds, etc. 🦄

A Very Good Infinite List Widget created by Very Good Ventures. Great for activity feeds, news feeds, etc. 🦄

InfiniteList comes in handy when building features like activity feeds, news feeds, or anywhere else where you need to lazily fetch and render content for users to consume.

Dec 12, 2022

Internationalized dialog for picking a single month from an infinite list of years.

Internationalized dialog for picking a single month from an infinite list of years.

month_picker_dialog Internationalized material style dialog for picking a single month from an infinite list of years. This package makes use of the i

Nov 30, 2022

Flutter bloc infinite list - A sample application to learn flutter bloc the correct way

flutter_bloc_infinite_list A sample application to learn flutter bloc the correc

Aug 22, 2022

🌈 Repository for a compass project, basically an App for displaying bank transfers, with API requests, Flag persistence, Infinite Scroll, Error Handling, Unit Tests, Extract Sharing working with SOLID, BLoC and Designer Patterns.

🌈 Repository for a compass project, basically an App for displaying bank transfers, with API requests, Flag persistence, Infinite Scroll, Error Handling, Unit Tests, Extract Sharing working with SOLID, BLoC and Designer Patterns.

💸 Green Bank Aplicação desenvolvida em Flutter com intuito de trabalhar conexão com API, Gerenciamento de estado usando BLoC, Refatoração, Arquitetur

Oct 7, 2022

Flutter implementation of sticky headers for sliver

Flutter implementation of sticky headers for sliver

flutter_sticky_header A Flutter implementation of sticky headers with a sliver as a child. Features Accepts one sliver as content. Header can overlap

Jan 3, 2023

Flutter Sticky Headers - Lets you place

Flutter Sticky Headers - Lets you place

Flutter Sticky Headers Lets you place headers on scrollable content that will stick to the top of the container whilst the content is scrolled. Usage

Dec 28, 2022

Sticky Grid View For Flutter

Sticky Grid View For Flutter

Features Listing images in gridview wrapped listview gives bad performance (disp

Nov 14, 2022
Comments
  • how to use it with NestedScrollView

    how to use it with NestedScrollView

    `import 'dart:async';

    import 'package:intl/intl.dart'; import 'package:flutter/material.dart'; import 'package:sticky_infinite_list/sticky_infinite_list.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', theme: ThemeData( // This is the theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try // changing the primarySwatch below to Colors.green and then invoke // "hot reload" (press "r" in the console where you ran "flutter run", // or simply save your changes to "hot reload" in a Flutter IDE). // Notice that the counter didn't reset back to zero; the application // is not restarted. primarySwatch: Colors.blue, ), home: MyHomePage(title: 'Flutter Demo Home Page'), routes: { SingleChildScrollPage.ROUTE: (_) => SingleChildScrollPage(), }, ); } }

    class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key);

    // This widget is the home page of your application. It is stateful, meaning // that it has a State object (defined below) that contains fields that affect // how it looks.

    // This class is the configuration for the state. It holds the values (in this // case the title) provided by the parent (in this case the App widget) and // used by the build method of the State. Fields in a Widget subclass are // always marked "final".

    final String title;

    @override _MyHomePageState createState() => _MyHomePageState(); }

    class _MyHomePageState extends State { final StreamController _streamController = StreamController.broadcast(); final ScrollController _scrollController = ScrollController(); Settings _settings = Settings();

    @override Widget build(BuildContext context) => Scaffold( appBar: AppBar( title: Text(widget.title), ), body: NestedScrollView( headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return [SliverAppBar( expandedHeight: 230.0, pinned: true, flexibleSpace: FlexibleSpaceBar( title: Text('复仇者联盟'), background: Image.network( 'http://img.haote.com/upload/20180918/2018091815372344164.jpg', fit: BoxFit.fitHeight, ), ), )]; }, body: ScrollWidget( settings: _settings, scrollController: _scrollController, stream: _streamController.stream, ), ) , );

    @override void dispose() { super.dispose();

    _streamController.close();
    

    } }

    class ScrollWidget extends StatelessWidget { final Stream stream; final ScrollController scrollController; final Settings settings;

    const ScrollWidget({ Key key, this.stream, this.scrollController, this.settings, }) : super(key: key);

    @override Widget build(BuildContext context) => InfiniteList( /// when direction changes dynamically, Flutter /// won't rerender scroll completely, /// which means that gesture detector on scroll itself /// remains from original direction key: Key(settings.scrollDirection.toString()), scrollDirection: settings.scrollDirection, anchor: settings.anchor, controller: scrollController, direction: settings.multiDirection ? InfiniteListDirection.multi : InfiniteListDirection.single, negChildCount: settings.negCount, posChildCount: settings.posCount, physics: settings.physics, builder: (context, index) { final date = DateTime.now().add( Duration( days: index, ) );

      if (settings.overlay) {
        return InfiniteListItem.overlay(
          mainAxisAlignment: settings.mainAxisAlignment,
          crossAxisAlignment: settings.crossAxisAlignment,
          headerStateBuilder: (context, state) => Padding(
            padding: const EdgeInsets.all(8.0),
            child: Container(
              decoration: BoxDecoration(
                shape: BoxShape.circle,
                color: Colors.orange.withOpacity(1 - state.position),
              ),
              height: 70,
              width: 70,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  Text(
                    date.day.toString(),
                    style: TextStyle(
                      fontSize: 21,
                      color: Colors.black87,
                      fontWeight: FontWeight.w600,
                    ),
                  ),
                  Text(
                    DateFormat.MMM().format(date),
                    style: TextStyle(
                      height: .7,
                      fontSize: 17,
                      color: Colors.black87,
                      fontWeight: FontWeight.w400,
                    ),
                  )
                ],
              ),
            ),
          ),
          contentBuilder: (context) => Padding(
            padding: const EdgeInsets.all(8.0),
            child: Container(
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(10),
                color: Colors.blueAccent,
              ),
              height: settings.contentHeight,
              width: settings.contentWidth,
              child: Center(
                child: Text(
                  DateFormat.yMMMMd().format(date),
                  style: TextStyle(
                      fontSize: 18,
                      color: Colors.white
                  ),
                ),
              ),
            ),
          ),
        );
      }
    
      return InfiniteListItem(
        mainAxisAlignment: settings.mainAxisAlignment,
        crossAxisAlignment: settings.crossAxisAlignment,
        positionAxis: settings.positionAxis,
        headerStateBuilder: (context, state) => Padding(
          padding: const EdgeInsets.all(8.0),
          child: Container(
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              color: Colors.orange.withOpacity(1 - state.position),
            ),
            height: 70,
            width: 70,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(
                  date.day.toString(),
                  style: TextStyle(
                    fontSize: 21,
                    color: Colors.black87,
                    fontWeight: FontWeight.w600,
                  ),
                ),
                Text(
                  DateFormat.MMM().format(date),
                  style: TextStyle(
                    height: .7,
                    fontSize: 17,
                    color: Colors.black87,
                    fontWeight: FontWeight.w400,
                  ),
                )
              ],
            ),
          ),
        ),
        contentBuilder: (context) => Padding(
          padding: const EdgeInsets.all(8.0),
          child: Container(
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(10),
              color: Colors.blueAccent,
            ),
            height: settings.contentHeight,
            width: settings.contentWidth,
            child: Center(
              child: Text(
                DateFormat.yMMMMd().format(date),
                style: TextStyle(
                    fontSize: 18,
                    color: Colors.white
                ),
              ),
            ),
          ),
        ),
      );
    },
    

    );

    }

    enum ScrollPhysicsEnum { PLATFORM, IOS, ANDROID, }

    class Settings { int negCount; int posCount; bool multiDirection; HeaderMainAxisAlignment mainAxisAlignment; HeaderCrossAxisAlignment crossAxisAlignment; HeaderPositionAxis positionAxis; double anchor; Axis scrollDirection; ScrollPhysicsEnum physicsType; bool overlay;

    bool get scrollVertical => scrollDirection == Axis.vertical;

    ScrollPhysics get physics { switch (physicsType) { case ScrollPhysicsEnum.PLATFORM: return null;

      case ScrollPhysicsEnum.ANDROID:
        return ClampingScrollPhysics();
    
      case ScrollPhysicsEnum.IOS:
        return BouncingScrollPhysics();
    }
    
    return null;
    

    }

    double get contentHeight { if (scrollVertical) { return 300; }

    return double.infinity;
    

    }

    double get contentWidth { if (scrollVertical) { return double.infinity; }

    return 300;
    

    }

    Settings({ this.negCount, this.posCount, this.mainAxisAlignment = HeaderMainAxisAlignment.start, this.crossAxisAlignment = HeaderCrossAxisAlignment.start, this.positionAxis = HeaderPositionAxis.mainAxis, this.multiDirection = false, this.anchor = 0, this.scrollDirection = Axis.vertical, this.physicsType = ScrollPhysicsEnum.PLATFORM, this.overlay = false, }); }

    class SingleChildScrollPage extends StatefulWidget { static const String ROUTE = "/single-child";

    @override _SingleChildScrollPageState createState() => _SingleChildScrollPageState(); }

    class _SingleChildScrollPageState extends State { static const double _headerHeight = 50;

    final StreamController<StickyState> _headerStream = StreamController<StickyState>.broadcast(); final StreamController<StickyState> _headerOverlayStream = StreamController<StickyState>.broadcast();

    @override Widget build(BuildContext context) { final height = MediaQuery.of(context).size.height;

    return Scaffold(
      appBar: AppBar(
        title: const Text('Single element example'),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            Container(
              height: height,
              color: Colors.lightBlueAccent,
              child: Placeholder(),
            ),
            StickyListItem<String>(
              streamSink: _headerStream.sink,
              header: Container(
                height: _headerHeight,
                width: double.infinity,
                color: Colors.orange,
                child: Center(
                  child: StreamBuilder<StickyState<String>>(
                    stream: _headerStream.stream,
                    builder: (_, snapshot) {
                      if (!snapshot.hasData) {
                        return Container();
                      }
    
                      final position = (snapshot.data.position * 100).round();
    
                      return Text('Positioned relative. Position: $position%');
                    },
                  ),
                ),
              ),
              content: Container(
                height: height,
                color: Colors.blueAccent,
                child: Placeholder(),
              ),
              itemIndex: "single-child",
            ),
            StickyListItem<String>.overlay(
              streamSink: _headerOverlayStream.sink,
              header: Container(
                height: _headerHeight,
                width: double.infinity,
                color: Colors.orange,
                child: Center(
                  child: StreamBuilder<StickyState<String>>(
                    stream: _headerOverlayStream.stream,
                    builder: (_, snapshot) {
                      if (!snapshot.hasData) {
                        return Container();
                      }
    
                      final position = (snapshot.data.position * 100).round();
    
                      return Text('Positioned overlay. Position: $position%');
                    },
                  ),
                ),
              ),
              content: Container(
                height: height,
                color: Colors.lightBlueAccent,
                child: Placeholder(),
              ),
              itemIndex: "single-overlayed-child",
            ),
            Container(
              height: height,
              color: Colors.cyan,
              child: Placeholder(),
            ),
          ],
        ),
      ),
    );
    

    }

    @override void dispose() { super.dispose();

    _headerStream.close();
    _headerOverlayStream.close();
    

    } }`

    maybe scroll has poblem

    opened by fangshengfy 0
Owner
Denis Beketsky
Denis Beketsky
Example Flutter App with fetch API

flutter_article Example Flutter App with fetch api from https://jsonplaceholder.typicode.com/ with http Getting Started This project is a starting poi

Alfian Andi Nugraha 3 Jul 26, 2022
Onboarding Screen,Alert & Lottie Animation Example.

rehberapp A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Hüseyin BAKAR 0 Dec 30, 2021
An example for the "transition" flutter package.

transition_package_flutter A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get y

Akshat Aryan 1 Jan 5, 2022
🐱‍👤 Flutter-Animation 🔥 🔥 List Animated Staggered Animations

??‍?? Staggered Animations made with algeria ❤

Hmida 17 Nov 22, 2022
An awesome list that curates the best Flutter libraries, tools, tutorials, articles and more.

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. If you appr

Robert Felker 44.6k Dec 30, 2022
A contact list UI clone for trainees during a national mobile development training session

contactapp A contact list UI clone for trainees during a national mobile development training session This project was built during a training session

bayorwor 4 Dec 14, 2021
Generate a timeline for a list

Timeline A flutter package that allows you to create basic timelines on your flutter application. This is customizable and easy to plugin to your appl

Rejish Radhakrishnan 65 Nov 10, 2022
filterList is a flutter package which provide utility to search/filter data from provided dynamic list.

filter_list Plugin FilterList is a flutter package which provide utility to search/filter on the basis of single/multiple selection from provided dyna

Sonu Sharma 156 Dec 24, 2022
A collection of Animations that aims to improve the user experience for your next flutter project.

A collection of Animations that aims to improve the user experience for your next flutter project.

Ezaldeen Sahb 134 Dec 24, 2022
A collection of Screens and attractive UIs built with Flutter ready to be used in your applications. No external libraries are used. Just download, add to your project and use.

Flutter Screens A collection of Login Screens, Buttons, Loaders and Widgets with attractive UIs, built with Flutter, ready to be used in your applicat

Samarth Agarwal 5k Dec 31, 2022