相关疑难解决方法(0)

Is it possible to animate the transition between the tabs of a CupertinoTabScaffold?

I'm using the sample below (taken from the CupertinoTabScaffold documentation page).

There is a "slide" transition when pushing a new route inside the tab, but when I click on a tabbar item, the content is brutally replaced. How can I have a transition when switching between tabs?

I would like implement something like that: https://github.com/Interactive-Studio/TransitionableTab

CupertinoTabScaffold(
  tabBar: CupertinoTabBar(
    items: [
      BottomNavigationBarItem(
        icon: Icon(CupertinoIcons.home),
        title: Text("Tab 0"),
      ),
      BottomNavigationBarItem(
        icon: Icon(CupertinoIcons.news),
        title: Text("Tab 1"),
      ),
    ],
  ),
  tabBuilder: (BuildContext context, …
Run Code Online (Sandbox Code Playgroud)

ios flutter flutter-cupertino

9
推荐指数
1
解决办法
357
查看次数

如何在推送路线颤动上创建淡入淡出过渡?

我正在尝试为推送路线创建淡入淡出过渡,为此创建了一个自定义路线,例如

class CustomPageRoute<T> extends MaterialPageRoute<T> {
  CustomPageRoute({WidgetBuilder builder, RouteSettings settings})
      : super(builder: builder, settings: settings);

  @override
  Widget buildTransitions(BuildContext context, Animation<double> animation,
      Animation<double> secondaryAnimation, Widget child) {
    return FadeTransition(opacity:animation, child: child,  );
  }
}
Run Code Online (Sandbox Code Playgroud)

并通过按下按钮调用它

onPressed: () {
   Navigator.push(context, CustomPageRoute(builder: (context) {
       return FirstScreen();
   }));
}
Run Code Online (Sandbox Code Playgroud)

但这给出了一个带有滑动+淡入淡出的奇怪动画。如何避免这里的滑动动画?

这是我的代码的输出:

这是输出

flutter flutter-animation

8
推荐指数
1
解决办法
4577
查看次数

如何在右侧滑动到新页面而不是向下滑动?

将新页面转移到焦点的默认颤动动画是从底部向上滑动.如何更改此行为并从右侧或左侧滑入新页面?

      Navigator.push(
        context,
          new PageRouteBuilder(
          pageBuilder: (BuildContext context, _, __) {
            return new SearchView();
          }
          )
      );
Run Code Online (Sandbox Code Playgroud)

dart material-design flutter flutter-layout

6
推荐指数
2
解决办法
4324
查看次数

如何在我的 Flutter 应用程序中从右侧导航添加 Slide?

我正在尝试 flutter 应用程序,我想通过幻灯片导航导航到我的下一个屏幕。新屏幕应该来自正确的动画。在 ios 中它是默认的,但在 android 中它没有发生。

有什么方法可以实现吗?

android ios flutter

2
推荐指数
1
解决办法
4290
查看次数