小编And*_*say的帖子

如何构建没有声音零安全性的 APK

我可以通过传递标志在我的手机上以发布模式运行应用程序--no-sound-null-safety --release,但既不能flutter build apk --enable-experiment=non-nullableflutter build apk --no-sound-null-safety 不能flutter build apk --enable-experiment=non-nullable --no-sound-null-safety 工作

apk dart flutter

10
推荐指数
3
解决办法
2万
查看次数

在小部件测试期间无法加载资源 SVG

我想在我的一些包含SvgPicture小部件的屏幕上进行小部件测试,但我不能这样做,因为它会引发异常。

\n

重现错误的代码:

\n
import \'package:flutter/material.dart\';\nimport \'package:flutter_svg/svg.dart\';\nimport \'package:flutter_test/flutter_test.dart\';\n\n\nvoid main() {\n  testWidgets(\n    \'SvgPicture.asset passes\',\n    (WidgetTester tester) async {\n      await tester.pumpWidget(MaterialApp(\n        home: Scaffold(\n          body: SvgPicture.asset(\'icons/pencil.svg\'),\n        ),\n      ));\n      await tester.pump();\n    },\n  );\n}\n
Run Code Online (Sandbox Code Playgroud)\n

执行结果:

\n
\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa1 EXCEPTION CAUGHT BY SVG \xe2\x95\x9e\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nThe following assertion was thrown resolving a single-frame picture stream:\nUnable to load asset: icons/pencil.svg\n\nWhen the exception was thrown, this was the stack:\n#0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:224:7)\n<asynchronous suspension>\n<asynchronous suspension>\n(elided one frame from package:stack_trace)\n...\n\nPicture provider: ExactAssetPicture(name: "icons/pencil.svg", bundle: null, colorFilter: null)\nPicture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#c2c00(), name: …
Run Code Online (Sandbox Code Playgroud)

testing svg unit-testing flutter

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

标签 统计

flutter ×2

apk ×1

dart ×1

svg ×1

testing ×1

unit-testing ×1