我试图从数据库中获取值后返回Map,Future但我无法打印这些值。访问值时出现以下错误
The type 'Future<Map<String, dynamic>> Function()' used in the 'for' loop must implement Iterable.
Run Code Online (Sandbox Code Playgroud)
下面是简单的代码。
class ChefDishes extends StatefulWidget {
@override
_ChefDishesState createState() => _ChefDishesState();
}
class _ChefDishesState extends State<ChefDishes> {
@override
Widget build(BuildContext context) {
var _chefDishes = DatabaseService().getChefDishList;
return Scaffold(
.....
Column(
children: [
for (var item in _chefDishes) // <---- E R R O R I S H E R E
ListView(children: [
Text(item['dishname']),
Text(item['dishPrice']),
]),
],
)
}
Run Code Online (Sandbox Code Playgroud)
DatabaseService 班级
class DatabaseService …Run Code Online (Sandbox Code Playgroud) 我正在用 Python 实现 Google Cloud Platforms-Data Loss Prevention API 的标准实现,用于去识别文本。这是来自https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/dlp/deid.py中deidentify_with_fpe方法的示例
当我使用下面提到的参数运行代码时,出现以下错误。
有人可以建议如何修复错误吗?
google.api_core.exceptions.InvalidArgument: 400 Received the following error message from Cloud KMS when unwrapping KmsWrappedCryptoKey "projects/xxxx-xxx/locations/global/keyRings/dlp-key-ring-4/cryptoKeys/key9": Decryption failed: the ciphertext is invalid.
Run Code Online (Sandbox Code Playgroud)
整个轨迹是
Last login: Fri Feb 28 15:29:09 on ttys001
Restored session: Fri 28 Feb 2020 15:27:53 AEDT
xxxxs-MacBook-Pro:poc-bucket-flow-dlp xxxxxxxx$ python dlp3.py --verbosity=debug
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
return callable_(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/grpc/_channel.py", line 826, in __call__
return _end_unary_response_blocking(state, …Run Code Online (Sandbox Code Playgroud)