- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据official docs pageBuilder
参数用于构建主要路由内容,transitionsBuilder
参数用于构建路由的转换。
所以它们都有不同的工作,但是如果 pageBuilder
用于构建主要路由内容,那么为什么它还在其 typedef RoutePageBuilder 中声明了两个 Animation
参数,也在 transitionBuilder
typedef RouteTransitionBuilder 中,有两个 Animation
参数声明为 animation
和 secondaryAnimation
。这两个 Animation
之间有什么区别以及我们如何使用它们?
最佳答案
routes.dart 中的文档:
/// [buildPage] is only called when the route is first built, and rarely
/// thereafter. In particular, it is not automatically called again when the
/// route's state changes unless it uses [ModalRoute.of]. For a builder that
/// is called every time the route's state changes, consider
/// [buildTransitions]. For widgets that change their behavior when the
/// route's state changes, consider [ModalRoute.of] to obtain a reference to
/// the route; this will cause the widget to be rebuilt each time the route
/// changes state.
///
/// In general, [buildPage] should be used to build the page contents, and
/// [buildTransitions] for the widgets that change as the page is brought in
/// and out of view. Avoid using [buildTransitions] for content that never
/// changes; building such content once from [buildPage] is more efficient.
/// The [buildTransitions] method, in contrast to [buildPage], is called each
/// time the [Route]'s state changes (e.g. the value of [canPop]).
///
/// The [buildTransitions] method is typically used to define transitions
/// that animate the new topmost route's comings and goings. When the
/// [Navigator] pushes a route on the top of its stack, the new route's
/// primary [animation] runs from 0.0 to 1.0. When the Navigator pops the
/// topmost route, e.g. because the use pressed the back button, the
/// primary animation runs from 1.0 to 0.0.
关于flutter - PageRouteBuilder的pageBuilder和transitionsBuilder typedef参数的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54229266/
Endeca 的 PageBuilder 会根据您正在查看的网站部分显示特定的登录页面。在我们安装的零售网站中,有大量的着陆页,因此排除故障可能很困难。考虑这种情况: 我创建了一个模板,该模板应在“部
我想使用 sulu 作为页面构建器。A 有一个包含多个元素的 block 。现在,我的下一个目标是提供用于显示“ Accordion 脚本”的字段。 元素包括 标题(文本行) 内容(文本编辑器) 我希
在 Flutter 中 go_router包,显然有两种创建新页面的方法,使用 builder 或 pageBuilder: GoRoute( name: 'Route', path: '/r
我已经安装了 Helix3 Template 和 SP Page Builder(免费版) Helix3 模板上缺少字体选项卡。模板和版式选项卡,其中可以为模板配置字体系列、字体粗细等基本内容。 CS
我是一名优秀的程序员,十分优秀!