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

flutter_scrolling_fab_animated 封面
套件詳情v0.1.5

flutter_scrolling_fab_animated

用於添加滾動時大小會變化的浮動按鈕的套件

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
484
喜歡數
68
Pub 分數
160

安裝套件

flutter pub add flutter_scrolling_fab_animated

套件介紹

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

一個 Flutter 套件,透過回應捲動事件來動畫化浮動操作按鈕(FAB),以提升使用者體驗。當使用者向下捲動時,FAB 會縮小或消失;向上捲動時,FAB 會放大或重新出現。此行為有助於維持介面整潔,同時確保主要操作始終可存取。該套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,非常適合實現一致的跨平台設計。

適用情境

  • 滾動驅動的浮動按鈕動畫
  • 透過動態浮動按鈕增強移動應用程式使用者體驗
  • 建立乾淨的介面並隱藏捲動時的浮動操作按鈕
  • 跨多個平台的一致性 FAB 行為
  • 改善可滾動列表中的視覺層次結構

主要特色

  • 滾動時自動 FAB 大小動畫
  • 跨平台相容性
  • 與現有滾動檢視的簡單整合
  • 可設定的動畫曲線
  • 支援收縮與展開的 FAB

適合對象

  • 行動與Web應用開發者
  • 專注於互動式 UI 的設計師
  • 包含長滾動內容的應用
  • 尋求輕量級 FAB 增強功能的開發者
  • 需要跨平台組件的專案

使用建議

  • 可能需要微調以獲得最佳動畫時間
  • 最適合單向滾動的螢幕
  • 除了大小和可見性之外,自訂選項有限
  • 不適合複雜的嵌套滾動場景
  • 取決於父滾動組件的行為

原始 README

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

Flutter Scrolling Fab Animated

This package is a floating button whose change of size when scroll down and return to its original size when on top again. It's useful with ListView widget and other scrollable widgets.

With animated icon

New Features 💥

  • Adding on long press support
  • Adding ripple effect for the button
  • Removing square shadow around the button when pressing it
  • Added gradient background

Instalation

Include flutter_scrolling_fab_animated in your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  flutter_scrolling_fab_animated: version

Usage

To use this package, just import it into your file and enjoy it.

import 'package:bottom_sheet_expandable_bar/bottom_sheet_bar_icon.dart';
import 'package:flutter_scrolling_fab_animated/flutter_scrolling_fab_animated.dart';

...

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Flutter Scrolling Fab Animated Demo'),
      ),
      body: Container(
        child: new ListView.builder(
          controller: _scrollController,
          itemCount: items.length,
          itemBuilder: (BuildContext ctxt, int index) {
            return new Card(
              child: ListTile(
                title: Text(items[index]),
              )
            );
          }
        ),
      ),
      floatingActionButton: ScrollingFabAnimated(
        icon: Icon(Icons.add, color: Colors.white,),
        text: Text('Add', style: TextStyle(color: Colors.white, fontSize: 16.0),),
        onPress: (){},
        scrollController: _scrollController,
        gradient: const LinearGradient(colors: [Color(0xff0CA2E6),Color(0xff2E3D97),],begin: Alignment.topCenter, end: Alignment.bottomCenter),
        animateIcon: true,
        inverted: false,
        radius: 10.0,
      )
    );
  }

...

Example with a GridView

import 'package:bottom_sheet_expandable_bar/bottom_sheet_bar_icon.dart';
import 'package:flutter_scrolling_fab_animated/flutter_scrolling_fab_animated.dart';

...

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Flutter Scrolling Fab Animated Demo'),
      ),
      body: Container(
        child: new GridView.builder(
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
          controller: _scrollController,
          itemCount: items.length,
          itemBuilder: (BuildContext ctxt, int index) {
            return new Card(
              child: ListTile(
                title: Center(child: Text(items[index])),
              )
            );
          }),
      ),
      floatingActionButton: ScrollingFabAnimated(
        icon: Icon(Icons.add, color: Colors.white,),
        text: Text('Add', style: TextStyle(color: Colors.white, fontSize: 16.0),),
        onPress: (){},
        scrollController: _scrollController,
        animateIcon: true,
        inverted: false,
        radius: 10.0,
      )
    );
  }

...

Properties
Name Description Required Default
icon Widget to use as button icon True
text Widget to use as button text when button is expanded True
onPress Function to use when press the button True
scrollController ScrollController to use to determine when user is on top or not True
elevation Double value to set the button elevation False 5.0
shadowColor Color value to set the button shadow color False ThemeData.shadowColor
width Double value to set the button width when is expanded False 120.0
height Double value to set the button height False 60.0
duration Value to set the duration for animation False 250 milliseconds
curve Value to set the curve for animation False Curves.easeInOut
limitIndicator Double value to set the boundary value when scroll animation is triggered False 10.0
color Color to set the button background color False Colors.blueAccent
gradient Color to set the button background gradient False null
animateIcon Value to indicate if animate or not the icon False true
inverted Value to inverte the behavior of the animation False false
radius Double value to set the button radius False null

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。