美文网首页
Fish-Redux with SingleTickerProv

Fish-Redux with SingleTickerProv

作者: DerekTime | 来源:发表于2022-07-05 10:24 被阅读0次

创建一个扩展类State

class AnimationComponentState extends ComponentState<OrderListState>
    with SingleTickerProviderStateMixin {}

class AnimationComponent extends Component<OrderListState> {
  @override
  AnimationComponentState createState() => AnimationComponentState();
}

在Page.dart文件内重写createState方法

  @override
  ComponentState<OrderListState> createState() {
    return AnimationComponentState();
  }

使用的地方

    TickerProvider tickerProvider = ctx.stfState as TickerProvider;
    ctx.state.tabController = TabController(
        length: 3,
        vsync: tickerProvider,
    );

相关文章

网友评论

      本文标题:Fish-Redux with SingleTickerProv

      本文链接:https://www.haomeiwen.com/subject/hgqsbrtx.html