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

bottom_bar_page_transition 封面
套件詳情v3.0.0

bottom_bar_page_transition

在使用底端欄導航時,顯示頁面之間的動畫效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
129
喜歡數
75
Pub 分數
150

安裝套件

flutter pub add bottom_bar_page_transition

套件介紹

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

bottom_bar_page_transition 套件可為使用底端導航列的 Flutter 應用程式提供順暢、動畫化的頁面間轉換效果。它透過在標籤頁之間導航時提供視覺連續性,提升使用者體驗,確保每次頁面切換都流暢且具目的性。此套件專為底端導航模式設計,可與標準的 BottomNavigationBar 小工具無縫整合。支援 Android、iOS、Web、macOS、Windows 及 Linux 多個平台,適用於跨平台應用。無需複雜的手動狀態管理,即可簡化自訂動畫的實作。

適用情境

  • 移動應用中的動畫標籤切換
  • 增強基於底部導航的介面中的使用者體驗
  • 跨平台導航與過渡
  • 建立精緻的應用入門流程
  • 在導航過程中添加視覺反饋
  • 支援動態內容變更

主要特色

  • 平滑的頁面過渡動畫
  • 內建對 BottomNavigationBar 的支援
  • 跨平台相容性
  • 所需設定最少
  • 可自定義的動畫類型
  • 適用於標準導航模式

適合對象

  • 使用底部導航的移動應用開發者
  • 注重設計的UI實現
  • 需要直覺導航的應用程式
  • 尋求快速動畫整合的開發者
  • 跨平台 Flutter 項目
  • 優先考慮使用者體驗的團隊

使用建議

  • 可能需要額外的樣式來實現複雜佈局
  • 僅限底部導航上下文
  • 動畫效能取決於裝置
  • 不適用於非底部導航的導航
  • 需要仔細處理狀態持久化
  • 最佳搭配一致的頁面結構使用

原始 README

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

bottom_bar_page_transition

Flutter package to display transition for switching pages beween bottom bar page navigation.

Previews

Circular Slide Fade

Features

  • Can be used to show animation while swiching pages in bottom navigation bar
  • Add global key to widget to avoid reinitate widget

Getting Started

Installing

To use this package, add bottom_bar_page_transition as a dependency in your pubspec.yaml file.

In your dart file import the library by

import 'package:bottom_bar_page_transition/bottom_bar_page_transition.dart';

In build method

return Scaffold(
      body: BottomBarPageTransition(
        builder: (_, index) => _getBody(index),
        currentIndex: _currentPage,
        totalLength: totalPage,
        transitionType: transitionType,
        transitionDuration: duration,
        transitionCurve: curve,
      ),
      bottomNavigationBar: _getBottomBar(),
    );

create `_getBody(int index) method to return body of the widget

Widget _getBody(int index) {
    return CustomScrollView(
      //key:_keys[index] //add keys to avoid initiate child widget after animation ends
      slivers: <Widget>[
        SliverAppBar(
          title: Text('Page $index'),
        ),
        SliverFillRemaining(
          child: Center(child: Text('Page $index')),
        )
      ],
    );
  }

create _getBottomBar() to create bottom bar

Widget _getBottomBar() {
    return BottomNavigationBar(
        currentIndex: _currentPage, 
        onTap: (index) {
          _currentPage = index;
          setState(() {});
        },
        selectedItemColor: Colors.blue,
        unselectedItemColor: Colors.grey,
        type: BottomNavigationBarType.fixed,
        items: List.generate(
            totalPage,
            (index) => BottomNavigationBarItem(
                  icon: Icon(icons[index]),
                  title: Text(names[index]),
                )));
  }

Parameter Description

builder - function to return content of widget
currentIndex - current displaying page
totalLength - total number of pages
transitionType - tractionType can be circle/slide/fade
transitionDuration - Duration of animation
transitionCurve - Curve is animation curve and they are used to adjust the rate of change of an animation over time

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。