小编Met*_*asa的帖子

为什么/什么时候你应该使用 __attribute__((noreturn))?

据我了解,该属性告诉编译器函数不会返回。当函数返回 void 时指定 this 有什么好处?

这两个功能有何不同?

void foo(){}
__attribute__((noreturn)) void foo(){}
Run Code Online (Sandbox Code Playgroud)

c c++ attributes

6
推荐指数
2
解决办法
1490
查看次数

如何将flutter移动应用迁移到flutter web

我有一个用 flutter 编写的移动应用程序,我想将其转换为 flutter_web 应用程序(集成 flutter_web 尚不可用)。我目前遇到了包裹问题。

我已按照本网站https://www.codemitter.com/how-to-add-web-counterpart-in-an-existing-flutter-project/中列出的说明进行操作

我收到以下错误

webdev could not run for this project.
You have a dependency on `cached_network_image` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `cloud_firestore` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `cupertino_icons` which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
You have a dependency on `firebase_core` …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-web

4
推荐指数
1
解决办法
1万
查看次数

如何在弹性框中的元素周围创建边框

我现在绘制的边框填充了屏幕的整个宽度。我希望它缩小到子元素的大小。

我尝试向弹性盒添加边框属性,但正如我所说,它填充了整个屏幕。

 <div class="mainThing">
     <div class="thing_row">
         <div class="thing_img">
             <img src="url" height="60">
         </div>
         <div class="thing_texts">
             <div class="noa_txt">NOW ON AIR</div>
             <div class="main_txt">The Royal Sunrise</div>
             <div class="peeps_txt">Meth, Pavan, Thinula and Jayavi</div>
         </div>
     </div>
 </div>
Run Code Online (Sandbox Code Playgroud)
.thing_row{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    border: solid black;
    flex-basis: content;
}

Run Code Online (Sandbox Code Playgroud)

我期望绘制边框,紧密贴合子元素,但它会填满屏幕的整个宽度。

html css web

4
推荐指数
1
解决办法
4万
查看次数

webdev 为 flutter_web helloworld 示例提供命令错误

我已经克隆了https://github.com/flutter/flutter_web存储库,我正在尝试在示例目录中运行 hello_world 程序。

我已经完成了 GitHub 页面中指示的所有内容。此外,我使用 apt 安装了 dart SDK,因为我遇到了另一个错误,“webdev dart: not found”,这是固定的。

现在我在运行“webdev serve”时遇到以下错误,“自生成 pubspec.lock 文件以来,pubspec.yaml 文件已更改,请再次运行“pub get”。

我运行了“flutter pub get”和“flutter pub upgrade”,这没有解决。

我希望这会在端口 8080 上启动 Web 服务器。输出

flutter pub get -v
Run Code Online (Sandbox Code Playgroud)

[  +18 ms] executing: [/home/meth/Documents/development/flutter/] git log -n 1 --pretty=format:%H
[  +21 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] 7a4c33425ddd78c54aba07d86f3f9a4a0051769b
[        ] executing: [/home/meth/Documents/development/flutter/] git describe --match v*.*.* --first-parent --long --tags
[   +7 ms] Exit code 0 from: git …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-web

1
推荐指数
1
解决办法
2012
查看次数

运行 NestJS 微服务时找不到 this.assertNotInPreviewMode

我有一个使用 NestJS 的微服务设置。但是,我在运行时收到以下错误。

this.assertNotInPreviewMode('listen');
             ^

TypeError: this.assertNotInPreviewMode is not a function
Run Code Online (Sandbox Code Playgroud)

我已经使用安装了 NestJS 微服务包npm i --save @nestjs/microservices。不知道为什么该功能不存在。

node.js nest microservices nestjs

1
推荐指数
1
解决办法
471
查看次数

标签 统计

dart ×2

flutter ×2

flutter-web ×2

attributes ×1

c ×1

c++ ×1

css ×1

html ×1

microservices ×1

nest ×1

nestjs ×1

node.js ×1

web ×1