首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何禁用颤振网的景观模式?

如何禁用颤振网的景观模式?
EN

Stack Overflow用户
提问于 2022-03-27 13:10:16
回答 1查看 339关注 0票数 3

我试图禁用手机用户在颤振网站上的景观模式。我用这段代码来禁用它,好吧,当我把这个项目作为一个应用程序运行时,它可以工作,但是它不适用于网络项目。

代码语言:javascript
运行
复制
  Widget build(BuildContext context) => ResponsiveSizer(
        builder: (context, orientation, screenType) {
          if (screenType == ScreenType.mobile) {
            SystemChrome.setPreferredOrientations(
                [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
          }

          return MaterialApp(
            title: 'App Title',
            debugShowCheckedModeBanner: false,
            theme: AppTheme.lightTheme,
            home: const HomePage(),
          );
        },
      );

知道如何做到这一点吗?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71636620

复制
相关文章

相似问题

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