【问题标题】:Why changing Theme isn't applied in full screen in a Chewie Video in Flutter?为什么在 Flutter 的 Chewie 视频中没有全屏应用更改主题?
【发布时间】:2021-07-29 07:49:14
【问题描述】:

我已将自定义主题数据应用于 Chewie 视频,它工作正常,但在全屏播放视频时不起作用,它只是返回到默认主题

@override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        Expanded(
          child: Center(
            child: _chewieController != null &&
                    _chewieController.videoPlayerController.value.isInitialized
                ? Theme(
                    data: Theme.of(context).copyWith(
                      accentColor: kPrimaryColor,
                      backgroundColor: kLightPrimaryColor,
                      iconTheme: IconThemeData(color: kPrimaryColor),
                    ),
                    child: Chewie(
                      controller: _chewieController,
                    ),
                  )
                : Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      LoadingCircle(),
                      SizedBox(height: 20),
                      Text('Loading'),
                    ],
                  ),
          ),
        ),
      ],
    );
  }

【问题讨论】:

    标签: flutter flutter-layout flutter-animation flutter-video-player flutter-theme


    【解决方案1】:

    我发现目前唯一可行的方法是将主题添加到整个应用程序中

    【讨论】:

      猜你喜欢
      • 2021-02-21
      • 2019-05-22
      • 2023-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-12
      • 2013-06-03
      • 1970-01-01
      相关资源
      最近更新 更多