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

draggable_expandable_fab 封面
套件詳情v1.0.0

draggable_expandable_fab

這個 Flutter 套件提供了一個可展開且可拖曳的浮動按鈕,並帶有動畫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
96
喜歡數
27
Pub 分數
150

安裝套件

flutter pub add draggable_expandable_fab

套件介紹

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

draggable_expandable_fab 套件透過一個可展開為多個動作的浮動操作按鈕,增強了 Flutter 應用的功能,並且可以拖曳至螢幕上的任何位置。它具備平滑的展開與移動動畫,提供互動性強且視覺上引人入勝的使用者體驗。適用於需要從單一按鈕快速存取多個功能的應用程式,支援所有主要平台,包含行動裝置、網頁與桌面端。該按鈕保持回應迅速且動作流暢,非常適合現代的手勢驅動介面。

適用情境

  • 快速存取多個動作
  • 基於手勢的導航
  • 互動式 UI 元素
  • 行動與桌面應用增強功能
  • 可自定義的操作選單
  • 增強使用者參與度

主要特色

  • 可拖曳的浮動按鈕
  • 可展開的操作選單
  • 平滑的動畫過渡
  • 跨平台支援
  • 可自定佈局
  • 響應式觸控處理

適合對象

  • 尋求互動式浮動操作按鈕的應用開發者
  • 想要動態UI組件的設計人員
  • 需要豐富手勢互動的專案
  • 移動應用中的多操作工具欄
  • 現代、動畫化的應用介面

使用建議

  • 可能影響低階裝置的效能
  • 需要仔細放置以避免重疊
  • 超出基本樣式之外的自訂功能有限
  • 不適合簡單的單動作使用案例
  • 需要在所有目標平台上進行測試

原始 README

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

Expandable Draggable Fab

This Flutter package provides a Expandable and Draggable Floating Button with animation.

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  draggable_expandable_fab: <latest version>

To use the latest changes:

  draggable_expandable_fab:
    git:
      url: https://github.com/Tughra/draggable_expandable_fab.git
      ref: master

❔ Usage

Import this class

import 'package:draggable_expandable_fab/draggable_expandable_fab.dart';

Replace Scaffold's parameters with these to better usage.

      floatingActionButtonAnimator: NoScalingAnimation(),
      floatingActionButtonLocation: ExpandableFloatLocation(),

Simple Implementation

Scaffold(
      floatingActionButtonAnimator: NoScalingAnimation(),
      floatingActionButtonLocation: ExpandableFloatLocation(),
      floatingActionButton: ExpandableDraggableFab(childrenCount: 3,
      distance: 100,// Animatiion distance during open and close. 
      children: [
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
      ],),
      body: Container(),
    );

Full Implementation

   final Size _size = MediaQuery.of(context).size;
    return Scaffold(
      floatingActionButtonAnimator: NoScalingAnimation(),
      floatingActionButtonLocation: ExpandableFloatLocation(),
      floatingActionButton: ExpandableDraggableFab(childrenCount: 3,
        onTab: (){
        debugPrint("Tab");
        },
        childrenTransition: ChildrenTransition.fadeTransation,
        initialOpen: false,
        childrenBoxDecoration: const BoxDecoration(color: Colors.red),
        enableChildrenAnimation: true,
        curveAnimation: Curves.linear,
        reverseAnimation: Curves.linear,
        childrenType: ChildrenType.columnChildren,
        closeChildrenRotate: false,
        childrenAlignment: Alignment.topRight,
        initialDraggableOffset: Offset(_size.width-90,_size.height-100),
      distance: 100,// Animation distance during open and close.
      children: [
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
      ],),
      body: Container(),
    );

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。