搜尋套件、儲存庫與 APP 分類

easy_sticky_header 封面
套件詳情v1.1.1

easy_sticky_header

一個容易使用且功能強大的黏性標題,適用於任何支援滾動的組件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
5630
喜歡數
56
Pub 分數
160

安裝套件

flutter pub add easy_sticky_header

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

easy_sticky_header 是一個 Flutter 套件,提供了一種簡單且彈性的方法來實現可滾動組件中的黏性標題。它會自動在滾動過程中保持標題始終顯示在頂部,從而提升具有分組內容的列表或網格的使用者體驗。此套件設計簡便易用,可無縫整合至 ListView、Scrollable 及其他主要平台上的可滾動元件。該套件支援自訂標題元件與順暢過渡效果,非常適合需要結構化可滾動資料顯示的應用程式。

適用情境

  • 分組列表檢視
  • 可捲動儀表板
  • 產品類別列表
  • 動態內容區域
  • 使用者資料時間線

主要特色

  • 自動標題黏附
  • 可自訂的標題小部件
  • 平滑過渡動畫
  • 跨平台相容性
  • 所需的設定最少
  • 支援嵌套可滾動元件

適合對象

  • 開發可捲動 UI 的開發者
  • 包含分類內容的應用程式
  • 尋求乾淨標題行為的設計師
  • 需要響應式佈局的專案
  • 重視開發速度的團隊

使用建議

  • 可能影響非常大的清單的效能
  • 在複雜的嵌套滾動中需要謹慎處理
  • 高級動畫的自訂功能有限
  • 未針對高度動態的標題內容進行優化
  • 最適合靜態或半靜態的標題設計

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

easy_sticky_header

platform pub license issues commits

English | 中文

An easy-to-use and powerful sticky header for any widget that supports scrolling.

Features

  • Support widget for horizontal or vertical scrolling
  • Support widget for reverse scrolling
  • Allow dynamic building of header widget and support custom transition animation
  • Header widget can dynamically change stickiness
  • Support jumping to the header widget of the specified index
  • Support header widget grouping
  • Support infinite list

Usage

Add dependency:

dependencies:
  easy_sticky_header: ^1.1.1

Import package:

import 'package:easy_sticky_header/easy_sticky_header.dart';

Example:

class Example extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return StickyHeader(
      child: ListView.builder(
        itemCount: 100,
        itemBuilder: (context, index) {
          // Custom header widget.
          if (index % 3 == 0) {
            return StickyContainerWidget(
              index: index,
              child: Container(
                color: Color.fromRGBO(Random().nextInt(256),
                    Random().nextInt(256), Random().nextInt(256), 1),
                padding: const EdgeInsets.only(left: 16.0),
                alignment: Alignment.centerLeft,
                width: double.infinity,
                height: 50,
                child: Text(
                  'Header #$index',
                  style: const TextStyle(
                    color: Colors.white,
                    fontSize: 16,
                  ),
                ),
              ),
            );
          }
          // Custom item widget.
          return Container(
            width: double.infinity,
            height: 80,
            color: Colors.white,
          );
        },
      ),
    );
  }
}

For more features, please go to the example project to see the details.

Screenshots

screenshot1 screenshot2 screenshot3
screenshot4 screenshot5 screenshot6
screenshot7 screenshot8 screenshot9

Contribution

You are welcome to contribute here 😄!

You can open an issue, if you find a bug, or want a new feature.

You can open up a PR, if you fixed a bug or implemented a new feature.

License

MIT License

Copyright (c) 2022 crasowas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。