搜索插件、代码仓与 APP 分类

bottom_bar_page_transition 封面
插件详情v3.0.0

bottom_bar_page_transition

在使用底部栏导航时,显示页面之间的动画效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
122
喜欢数
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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。