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

animated_button_bar 封面
套件詳情v1.0.0

animated_button_bar

一個高度可自訂的按鈕欄,選取項目具有動畫效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
604
喜歡數
82
Pub 分數
150

安裝套件

flutter pub add animated_button_bar

套件介紹

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

一個可自訂的 Flutter 按鈕欄,當選取項目時會有順暢的動畫效果。它允許開發者建立互動式、視覺上吸引人的導航列,並在按鈕之間實現動畫過渡。此套件支援多個平台,並提供豐富的樣式選項,包括顏色、形狀和動畫持續時間。非常適合需要直覺的類似標籤頁導航並帶有動態反饋的應用程式。

適用情境

  • 互動式導航欄
  • 標籤式介面
  • 動畫使用者介面轉換
  • 可自訂的底端導航
  • 使用者對選擇的反饋
  • 行動與Web應用儀表板

主要特色

  • 平滑的選擇動畫
  • 高度可自訂的外觀
  • 跨平台支援
  • 可設定的動畫持續時間
  • 靈活的佈局選項
  • 支援輕觸手勢

適合對象

  • Flutter 開發者建構現代 UI
  • 需要動畫導航的應用
  • 專注於使用者體驗的設計師
  • 針對多個平台的專案
  • 希望擁有可重用組件的開發者

使用建議

  • 包含大量項目時可能影響效能
  • 需要仔細調整動畫速度
  • 有限的內建主題
  • 不適用於簡單的靜態按鈕
  • 依賴於正確的狀態管理
  • 最佳搭配響應式設計模式使用

原始 README

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

animated_button_bar

AnimatedButtonBar is a flutter library that allows you to create a row of buttons with an animation on selection.

Getting started

Add this to your app's pubspec.yaml file:

dependencies:  
  animated_button_bar: ^0.0.2

Usage

Then you have to import the package with:

import 'package:animated_button_bar/animated_button_bar.dart';  

And use an AnimatedBarButton like this:

  Column(  
          mainAxisAlignment: MainAxisAlignment.center,  
          children: [  
            //inverted selection button bar  
            AnimatedButtonBar(  
              radius: 8.0,  
              padding: const EdgeInsets.all(16.0),  
              invertedSelection: true,  
              children: [  
                ButtonBarEntry(onTap: () => print('First item tapped'), child: Text('Day')),  
                ButtonBarEntry(onTap: () => print('Second item tapped'), child: Text('Week')),  
                ButtonBarEntry(onTap: () => print('Third item tapped'), child: Text('Month')),  
                ButtonBarEntry(onTap: () => print('Fourth item tapped'), child: Text('Year'))  
              ],  
            ),  
            //You can populate it with different types of widgets like Icon  
            AnimatedButtonBar(  
              radius: 32.0,  
              padding: const EdgeInsets.all(16.0),  
              backgroundColor: Colors.blueGrey.shade800,  
              foregroundColor: Colors.blueGrey.shade300,  
              elevation: 24,  
              borderColor: Colors.white,  
              borderWidth: 2,  
              innerVerticalPadding: 16,  
              children: [  
                ButtonBarEntry(onTap: () => print('First item tapped'), child: Icon(Icons.person)),  
                ButtonBarEntry(onTap: () => print('Second item tapped'), child: Icon(Icons.people)),  
              ],  
            ),  
          ],  
        ),  

Result

parameters

parameter description default
animationDuration animation duration when tap const Duration(milliseconds: 200)
backgroundColor main color of the widget Theme.of(context).backgroundColor
borderColor color of the border null
borderWidth width of the border borderColor != null ? 1.0 : 0.0;
children A list of ButtonBarEntry to display required
curve the curve for the animation Curves.fastOutSlowIn
elevation double 0
foregroundColor color for the selection Theme.of(context).accentColor
invertedSelection bool false
radius double 0.0
verticalPadding double 8.0

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案