小编Hut*_*yad的帖子

VS 代码不会在调试控制台中显示 Flutter 错误

出于某种原因,VS 代码中的 flutter 停止显示错误。没有运行时或异常错误。即使我故意将空值放在任何地方,控制台中也没有显示任何内容。

红色崩溃屏幕出现在设备和模拟器上,但在控制台输出中没有任何详细信息。没有一个错误。这张图就是我说的,它不见了

有人遇到过这样的事情吗?谢谢

dart visual-studio-code flutter vscode-settings

8
推荐指数
2
解决办法
1245
查看次数

Flutter web - 子域

有人可以解释一下我如何在 flutter web 中为每个用户使用子域吗? 喜欢这个项目

谢谢

subdomain web dart flutter

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

Google Ads API - “失败,状态为“PERMISSION_DENIED” - “用户无权访问客户。”

我正在尝试使用 Google-ads-API。运行 Ubuntu 20.04、Python 3.9(客户端库运行的最低要求是 3.6),使用 google-ads-api V6。这是我痛苦的故事。

我已经创建了一个测试经理帐户 [A],生成了一个开发人员的令牌,并且拥有使用 API 的“测试级别”访问权限,这很棒。测试级别允许您调用有关处理测试帐户(非生产)的信息\报告的 API。

此外,通过帐户 [A] 的整个 Oauth2 凭据,允许测试电子邮件,并在运行“examples/authentication/authenticate_in_web_application.py”后,我被重定向到一个网页,允许我的主要测试经理帐户访问第二个测试经理帐户[B](按照文档的指示,创建另一个测试经理帐户[B],除了带有开发者令牌的主帐户[A]),从此OAuth2提示成功生成刷新令牌,以允许帐户[B] ] 管理我的帐户 [A],将刷新令牌添加到我的 google-ads.yaml 文件中,一切都很好。

当我从示例中运行这个 .py 文件时

python3 google-ads-python/examples/account_management/list_accessible_customers.py
Run Code Online (Sandbox Code Playgroud)

结果是这样的:

Total results: 2
Customer resource name: "customers/1792845307"
Customer resource name: "customers/5341438919"
Run Code Online (Sandbox Code Playgroud)

可爱,花了 2 天时间才走到这一步。现在已经两天了,试图通过以下。请注意,以上结果均来自我的帐户 [B],获取这些结果的 API 请求是在 google-ads.yaml 文件中设置帐户 [A] 的开发人员令牌时发出的。

因此,.yaml 文件现在包含帐户 [A] 的开发者帐户令牌、云控制台 (.json) 文件中帐户 [A] 的 OAuth 凭据。由步骤 1 中的身份验证产生的帐户 [B] 的刷新令牌。

继续,通过运行“get_account_information.py”,它也在示例文件夹中,并将上述结果中的一个帐户传递给它[强制标志 --c,这是客户端 ID),我不断获得访问权限拒绝错误:

python3 get_account_information.py --c 5341438919 我明白了:

Request with ID "LhKeU9ZI4zZgnp05VSHbjg" failed with status "PERMISSION_DENIED" …
Run Code Online (Sandbox Code Playgroud)

python google-ads-api

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

未处理的异常:PlatformException (sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) - 在一个系统中运行良好

我正在使用 flutter 中的平台通道(使用 Java)开发蓝牙应用程序。但是当我尝试使用 google-sign in( google_sign_in: ^4.5.6 ) 登录时,我收到错误。\n我可以登录详细信息,但无法移动到下一页......\n实际上,它在我的办公系统中工作,但是当我复制该项目并在另一个系统中运行时,它给出了错误......任何人都可以帮忙吗

\n
main.dart\nimport 'package:bmsapp2/pages/loginpage.dart';\nimport 'package:flutter/material.dart';\n\nvoid main() {\n  runApp(BmsApp());\n}\n\nclass BmsApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    const curveHeight = 12.0;\n    return MaterialApp(\n      home: SafeArea(\n        child: Scaffold(\n          appBar: AppBar(\n            backgroundColor: Colors.amber[900],\n            shape: const MyShapeBorder(curveHeight),\n          ),\n          body: LoginPage(),\n        ),\n      ),\n    );\n  }\n}\n\nclass MyShapeBorder extends ContinuousRectangleBorder {\n  const MyShapeBorder(this.curveHeight);\n  final double curveHeight;\n\n  @override\n  Path getOuterPath(Rect rect, {TextDirection textDirection}) => Path()\n    ..lineTo(0, rect.size.height)\n    ..quadraticBezierTo(\n      rect.size.width / 2,\n      rect.size.height + curveHeight * 2,\n      rect.size.width,\n      rect.size.height,\n …
Run Code Online (Sandbox Code Playgroud)

java android firebase firebase-authentication flutter

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

TypeError:无法读取未定义错误的属性“app” - Flutter 在 Flutter Web 应用程序中使用 firebase Auth 和 Firestore

 Running with sound null safety 
TypeError: Cannot read property 'app' of undefined
    at Object.app$ [as app] (http://localhost:49841/packages/firebase_core_web/src/interop/core.dart.lib.js:42:101)
    at new cloud_firestore_web.FirebaseFirestoreWeb.new (http://localhost:49841/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:988:64)
    at Function.registerWith (http://localhost:49841/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:842:73)
    at Object.registerPlugins (http://localhost:49841/packages/nse7a/generated_plugin_registrant.dart.lib.js:33:46)
    at main (http://localhost:49841/web_entrypoint.dart.lib.js:41:35)
    at main.next (<anonymous>)
    at runBody (http://localhost:49841/dart_sdk.js:37229:34)
    at Object._async [as async] (http://localhost:49841/dart_sdk.js:37260:7)
    at main$ (http://localhost:49841/web_entrypoint.dart.lib.js:40:18)
    at http://localhost:49841/main_module.bootstrap.js:19:10
    at Array.forEach (<anonymous>)
    at window.$dartRunMain (http://localhost:49841/main_module.bootstrap.js:18:32)
    at <anonymous>:1:8
    at Object.runMain (http://localhost:49841/dwds/src/injected/client.js:8656:21)
    at http://localhost:49841/dwds/src/injected/client.js:22068:19
    at _wrapJsFunctionForAsync_closure.$protected (http://localhost:49841/dwds/src/injected/client.js:3830:15)
    at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:49841/dwds/src/injected/client.js:10905:12)
    at Object._asyncStartSync (http://localhost:49841/dwds/src/injected/client.js:3794:20)
    at main__closure1.$call$body$main__closure (http://localhost:49841/dwds/src/injected/client.js:22080:16)
    at main__closure1.call$1 (http://localhost:49841/dwds/src/injected/client.js:22007:19)
    at StaticClosure._rootRunUnary [as call$2$5] (http://localhost:49841/dwds/src/injected/client.js:4153:16)
    at …
Run Code Online (Sandbox Code Playgroud)

web firebase flutter flutter-web

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

在 flutter 中映射 Firebase 流

我主要通过阅读这里的帖子和观看 YouTube 视频来学习 flutter,但似乎我已经达到了视频不能满足我需要的程度,所以我来这里寻求帮助。

我正在尝试了解 Streams、Firebase 和映射。

我需要使用 Riverpod 创建一个 StreamProvider。这是我用来创建 StreamProvider 的代码:

final trxnStreamProvider = StreamProvider.autoDispose<List<Trxns>>((ref) {
  final stream = firestoreService.getAgencyTrxns();
  return stream.map((snapshot) => snapshot.docs.map((doc) =>
      Trxns.fromFirestore(doc.data)).toList());
});
Run Code Online (Sandbox Code Playgroud)

我在这段代码中从 Firebase 获取流:

  Stream<QuerySnapshot> getAgencyTrxns() async* {
    yield* FirebaseFirestore.instance
        .collection('agency').doc(globals.agencyId)
        .collection('trxns')
        .where('trxnStatus', isNotEqualTo: 'Closed')
        .snapshots();
  }
Run Code Online (Sandbox Code Playgroud)

因此,我根据上面的代码片段从 Firebase 获取了 QuerySnapshot。这效果很好。

然后,此 QuerySnapshot 返回到我创建 StreamProvider 的第一个代码片段中的“stream”变量。

然后,QuerySnapshot 变量“stream”被映射到 <List> 并通过此代码返回到 trxnStreamProvider。

return stream.map((snapshot) => snapshot.docs.map((doc) =>
          Trxns.fromFirestore(doc.data)).toList());
Run Code Online (Sandbox Code Playgroud)

我在“doc.data”处收到错误,指出:参数类型“对象?” Function()' 无法分配给参数类型 'Map<String,dynamic>'。

我试图了解这行代码到底在做什么,我需要你的帮助。

return stream.map((snapshot) => snapshot.docs.map((doc) =>
          Trxns.fromFirestore(doc.data)).toList());
Run Code Online (Sandbox Code Playgroud)

让我告诉你我认为它在做什么:

  1. 变量stream有一个名为“map”的方法,调用该方法将QuerySnapshot映射到列表。我不确定“快照”来自哪里,但我认为它是通过此调用 firestoreService.getAgencyTrxns() …

stream firebase flutter google-cloud-firestore

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