首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >定位了调试和发布moe之间的OverlayEntry不一致

定位了调试和发布moe之间的OverlayEntry不一致
EN

Stack Overflow用户
提问于 2020-10-07 23:06:07
回答 1查看 29关注 0票数 1

我正在使用Overlay在我的应用程序中实现一些教程步骤,但在调试和发布模式下插入条目的位置是不同的。此外,它在iOS上的生产环境中看起来更糟糕:

调试模式:

发布模式(Android):

发布模式(iOS):

下面是代码:

代码语言:javascript
复制
  Future<void> _handleTutorial() async {
    if (!widget.enableTutorial)
      return;

    // Get sizes
    final RenderBox renderBox = context.findRenderObject();
    final offset = renderBox.localToGlobal(Offset.zero);

    // Render if tutorial is enabled
    _tutorialEntry = OverlayEntry(builder: (context) {
      return Positioned(
        top: offset.dy,
        left: offset.dx,
        right: 0,
        child: FadeInOutAnimation(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              
              // Overlay widget
              Material(
                color: Colors.transparent,
                child: DatesTitle(section: widget.section, isTutorialSample: true),
              ),
              
              // Information text
              PopUpAnimation(
                child: Padding(
                  padding: const EdgeInsets.only(left: 50, right: 18),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Column(
                        children: [
                          Row(
                            children: const [
                              TutorialInclinedTapHand(),
                              SizedBox(width: 20),
                              Expanded(child: TutorialText('Tap to change the number of days in this province'))
                            ],
                          ),
                          const SizedBox(height: 20),
                          TutorialButton(onPressed: widget.onTutorialComplete)
                        ],
                      )
                    ],
                  ),
                ),
              )
              
            ],
          ),
        ),
      );
    });
    _overlay.insert(_tutorialEntry);

  }

我如何修复这些不一致?

EN

回答 1

Stack Overflow用户

发布于 2020-10-07 23:14:39

我认为这与debug banner有关。您可以将其设置为false,然后重新定位小部件。

代码语言:javascript
复制
 debugShowCheckedModeBanner: false
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64246931

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档