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

slidable_bar 封面
套件詳情v1.1.1

slidable_bar

一個用於顯示側邊欄並隱藏它以及自訂點擊行為的Flutter套件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
61
喜歡數
48
Pub 分數
150

安裝套件

flutter pub add slidable_bar

套件介紹

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

SlidableBar 是一個 Flutter 套件,讓開發者能在多個平台實現可自訂的滑動側邊欄導航元件。它允許使用者透過平滑的動畫來顯示或隱藏側邊欄,提供設計與互動上的彈性。該套件支援側邊欄外觀與行為的各種自訂選項,非常適合需要直覺導航的應用程式。它能順暢地整合至 Flutter 專案中,並適用於 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 實現可摺疊的導航選單
  • 為移動設備和網頁創建響應式佈局
  • 新增側邊欄控制的滑動手勢
  • 設計自定義抽屜介面
  • 建構儀表板式應用程式
  • 透過動畫過渡提升使用者體驗

主要特色

  • 平滑滑動動畫
  • 可自定側邊欄外觀
  • 支援滑動手勢
  • 跨平台相容性
  • 與現有 Flutter 應用輕鬆整合
  • 可設定的開啓/關閉行為

適合對象

  • 開發導航密集型應用的開發者
  • 尋求互動式UI元件的設計師
  • 面向多個平台的專案
  • 需要輕量級導航解決方案的應用程式
  • 使用 Flutter 進行全端開發的團隊
  • 原型設計動態UI佈局

使用建議

  • 可能需要額外的樣式才能實現複雜的設計
  • 側邊欄內包含大量小部件時的性能影響
  • 與其他套件相比,內建主題較少
  • 需要仔細處理手勢衝突
  • 未針對非常大的導航項目進行優化
  • 最適合中等規模的導航結構

原始 README

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

slidable_bar

A Flutter side bar slider can be with any widget you want

review

Features

  • The SlidableBar can have four positions: top, bottom, right and left.
  • Customizable clicker, you can change the clicker widget with what you want.
  • Just like Flutter's Drawer, but with new way.

Things to note

  • The SlidableBar should have specific width and height, it works fine with scaffold's body.
  • The SlidableBar doesn't create it's own context, so it will appear under floating action button if you add one.

Usage

    final SlidableBarController controller = SlidableBarController(initialStatus: true);
    
    SlidableBar(
        size: 50, // this will be bar's height in case Side is bottom or top and width in case Side is left or right 
        children: <Widget>[], // here is the widgets inside the bar
        child: Container(), // here is your widget that will be under the bar 
        // optional
        frontColor: Colors.green, // the color of the cycle inside the default clicker
        slidableController: controller, // the contoller to change and listen to the bar status
        barRadius: const BorderRadius.circular(10.0), // the contoller to change and listen to the bar status
        side: Side.bottom, // Side.right is the default
        clickerPosition: 1.0, // the position of the clicker, 0.0 is the default
        clickerSize: 60, // the sizer of the default clicker, 55 is the default
        onChange: (int index){
            print(index); // this will print the index of the widget you clicked inside the bar
        },
        duration: Duration(milliseconds: 500), // the duration of the animation, (300 mil) is the default
        isOpenFirst: true, // the initial state of the bar, false is default
        backgroundColor: Colors.black, // primary color is default
        curve: Curves.ease, // the animation curve, linear is defualt
        clicker: Icon(Icons.arrow_forward_ios), // this will build instead of the default clicker
      )

Getting started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  slidable_bar: "^1.1.0"

Then run $ flutter pub get. In your library, add the following import:

import 'package:slidable_bar/slidable_bar.dart';

Preview Images (The positions)

right left

top bottom

Custom Clicker

custom-clicker

Author

Mahmoud Haj Ali - GitHub

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。