简体   繁体   English

如何使用具有良好动画颤动的动态浮动动作按钮创建底部导航栏?

[英]how to create bottom nav bar with dynamic floating action button with good animation flutter?

I would like to create a custom bottom nav bar with a changed floating action button like this:我想创建一个自定义底部导航栏,其中包含如下更改的浮动操作按钮:

在此处输入图片说明

and when change tab it will be like this with nice and ease animation:当更改选项卡时,它会是这样的,带有漂亮而轻松的动画:

在此处输入图片说明

any suggestions how we can built it.我们如何构建它的任何建议。

You can use for this design您可以用于此设计

ff_navigation_bar package here ff_navigation_bar在这里

motion_tab_bar package here motion_tab_bar在这里

fancy_bottom_navigation here hope its helpful to you.这里的fancy_bottom_navigation希望对你有帮助。

for more packages for bottom navigation bar go here有关底部导航栏的更多包,请转到此处

You can try with the Convex_bottom_bar您可以尝试使用Convex_bottom_bar

And here all bottom_nav_bar package这里所有的bottom_nav_bar


import 'package:convex_bottom_bar/convex_bottom_bar.dart';
import 'package:flutter/material.dart';


void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  State createState() => _State();
}

class _State extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      initialRoute: "/",
      routes: {
        "/": (_) => HelloConvexAppBar(),
        "/bar": (BuildContext context) => Container(),
        "/custom": (BuildContext context) => Container(),
        "/fab": (BuildContext context) => Container(),
      },
    );
  }
}

class HelloConvexAppBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Hello ConvexAppBar')),
      body: Center(
          child: TextButton(
            child: Text('Click to show full example'),
            onPressed: () => Navigator.of(context).pushNamed('/bar'),
          )),
      bottomNavigationBar: ConvexAppBar(
        style: TabStyle.react,
        items: [
          TabItem(icon: Icons.list),
          TabItem(icon: Icons.calendar_today),
          TabItem(icon: Icons.assessment),
        ],
        initialActiveIndex: 1,
        onTap: (int i) => print('click index=$i'),
      ),
    );
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter 中的浮动底部导航栏和浮动操作按钮 - Floating Bottom Nav Bar and Floating Action Button in Flutter Flutter 转换 animation 打破底部导航栏中浮动操作按钮的“按下” function。 需要解决方法 - Flutter transform animation breaks “on pressed” function of floating action button in bottom nav bar. Workaround needed 带有浮动操作按钮的底部导航栏 flutter - bottom navigation bar with Floating Action Button flutter Flutter 使浮动动作粘在底部导航栏 - Flutter make floating action stick to bottom nav bar 使用浮动操作按钮将渐变颜色应用于底部导航栏 - Apply Gradient colours to Bottom Nav bar with floating action button 底部导航栏中的可扩展浮动操作按钮 - Flutter - Expandable Floating Action button in bottom navigation bar - Flutter 如何使用浮动操作按钮自定义底部导航栏以及左右曲线设计? - How to customize a bottom navigation bar in flutter with floating action button and and also curve design to the left and right? 如何在 flutter 中创建浮动按钮栏? - how to create floating button bar in flutter? 如何在带边框的中心底部导航栏中添加浮动操作按钮? - How to add Floating action Button in Bottom Navigation Bar in Center with border? 如何在带有缺口的底部导航栏中心添加浮动操作按钮? - How to add Floating action Button in Bottom Navigation Bar Center with notch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM