Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否移除内部的MaterialApp组件 #6

Closed
mengyanshou opened this issue Aug 1, 2021 · 6 comments
Closed

能否移除内部的MaterialApp组件 #6

mengyanshou opened this issue Aug 1, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@mengyanshou
Copy link

如readme所说,我们不得不为弹窗额外添加一个参数,我认为这是侵入性的。

void runAppWithTool(Widget app) {
  runApp(Directionality(
    child: MediaQuery(
      data: MediaQueryData.fromWindow(window),
      child: Localizations(
        locale: const Locale('en', 'US'),
        delegates: _localizationsDelegates.toList(),
        child: Stack(
          children: [
            app,
            UME(),
          ],
        ),
      ),
    ),
    textDirection: TextDirection.ltr,
  ));
}

例如上面的代码同样也能实现UME悬浮组件的显示,或者通过Overlay组件,至少这都不会为我们的app新增加一个路由栈。

@smileShirely
Copy link
Collaborator

如readme所说,我们不得不为弹窗额外添加一个参数,我认为这是侵入性的。

void runAppWithTool(Widget app) {
  runApp(Directionality(
    child: MediaQuery(
      data: MediaQueryData.fromWindow(window),
      child: Localizations(
        locale: const Locale('en', 'US'),
        delegates: _localizationsDelegates.toList(),
        child: Stack(
          children: [
            app,
            UME(),
          ],
        ),
      ),
    ),
    textDirection: TextDirection.ltr,
  ));
}

例如上面的代码同样也能实现UME悬浮组件的显示,或者通过Overlay组件,至少这都不会为我们的app新增加一个路由栈。

@Nightmare-MY 感谢反馈。UME 有考虑对插件层级调整,并移除独立 MaterialApp,这部分调整预期会在下一个大版本实现,还需要一些时间

@mengyanshou
Copy link
Author

期待新版的发布~

@smileShirely
Copy link
Collaborator

smileShirely commented Aug 6, 2021

#13 Merged.

修改 pubspec.yaml 中内容:

dependency_overrides:
  flutter_ume:
    git: https://github.com/bytedance/flutter_ume.git
    ref: develop_nullsafety

@Nightmare-MY 试一下?

@smileShirely smileShirely added the enhancement New feature or request label Aug 6, 2021
@mengyanshou
Copy link
Author

#13 Merged.

修改 pubspec.yaml 中内容:

dependency_overrides:
  flutter_ume:
    git: https://github.com/bytedance/flutter_ume.git
    ref: develop_nullsafety

@Nightmare-MY 试一下?

好的~

@smileShirely
Copy link
Collaborator

@Nightmare-MY 请问针对本 Issue 还有什么问题吗

@mengyanshou
Copy link
Author

@Nightmare-MY 请问针对本 Issue 还有什么问题吗

没有了哦,感谢支持~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants