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

套件詳情v0.1.0

appbar_elevation

一個 Flutter 小工具,用於初始時與主體對齊的 AppBar,滾動時會提升。

近 30 天下載
50
喜歡數
17
Pub 分數
40

安裝套件

flutter pub add appbar_elevation

套件介紹

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

appbar_elevation 套件提供了一個 Flutter 小工具,該小工具創建一個初始時與螢幕主體齊平的 AppBar,並在使用者向下捲動時自動抬升(上升)。此行為透過僅在捲動期間顯示 AppBar 來增強視覺層次,提供乾淨的初始視圖。非常適合內容清單較長的應用程式,動態 AppBar 可改善使用者體驗。該小工具輕量且可無縫整合至現有的可捲動版面,例如 ListView 或 CustomScrollView。支援平滑過渡,無需複雜的自訂邏輯即可運作。原始碼公開於 GitHub,確保透明度並支援貢獻。

適用情境

  • 可滾動列表中的動態 App Bar 外觀
  • 透過微妙的抬升效果增強使用者介面
  • 建立現代、響應式的應用程式介面
  • 改善滾動過程中的視覺反饋
  • 簡化 AppBar 影子邏輯

主要特色

  • 滾動時自動提升
  • 初始沖洗狀態,帶有正文
  • 平滑過渡動畫
  • 輕量且容易整合
  • 適用於 ListView 和 CustomScrollView

適合對象

  • 尋求優雅 AppBar 行為的開發者
  • 具有長滾動內容的應用程式
  • 以UI為中心的Flutter專案
  • 極簡設計實現
  • 旨在實現原生滾動效果的項目

使用建議

  • 需要可滾動的父容器
  • 超出高程的客製化選項有限
  • 不支援平台特定行為
  • 可能需要為非預設主題添加額外的樣式
  • 不適用於靜態或非滾動螢幕

原始 README

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

appbar_elevation

pub package

A Flutter Widget for an AppBar that is initially flush with the body and elevated when scrolled.

Usage

Use the ScrollActivatedAppBarElevation widget to wrap a Scaffold that contains a Scrollable view (e.g. ListView, CustomScrollView). The widget uses a NotificationListener to detect the scroll position and provides an appBarElevation value to be used.

Example

@override
Widget build(BuildContext context) {
  return ScrollActivatedAppBarElevation(
    builder: (BuildContext context, double appBarElevation) {
      return Scaffold(
        appBar: AppBar(
          elevation: appBarElevation,
        ),
        body: ListView(
          children: [
            // ...
          ],
        ),
      );
    },
  );
}

See example for full code.

License

BSD

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。