0

我已将自定义主题数据应用于 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'),
                    ],
                  ),
          ),
        ),
      ],
    );
  }
4

1 回答 1

0

我发现现在工作的唯一方法是将主题添加到整个应用程序

于 2021-05-07T00:36:39.517 回答