flutter - Flutter Firestore 数据传输
问题描述
我正在为我的应用程序创建一个转账功能,这样当按下转账按钮时,输入的金额将被转账到目标电子邮件的帐户。
请注意,我特意将文档 id 设置为用户的 uid。
以下是我到目前为止的代码,
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(height: 15),
TextFormField(
keyboardType: TextInputType.number,
controller: _amount,
decoration: InputDecoration(
hintText: 'Amount',
helperText:'Enter the amount of money you would like to transfer',
),
),
SizedBox(height: 15),
TextFormField(
controller: _reference,
decoration: InputDecoration(
hintText: 'Transfer Details',
helperText: 'Enter a Recipient Reference',
),
),
SizedBox(height: 15),
sendButton(_amount.text),
],
),
和
RaisedButton sendButton(String _amount) {
return RaisedButton(
color: Colors.green,
shape: StadiumBorder(),
child: Text(
'Send',
style: TextStyle(
color: Colors.white,
),
),
onPressed: () async {
},
);
}
我想这样做,所以当我按下按钮时,我当前登录用户的钱(来自 firestore 字段)将转移到目标收件人的帐户。
我对 Firestore 和 Flutter 还很陌生,所以如果这不可能,也可以是减去当前用户的钱并将相同金额添加到收款人的钱中。
解决方案
推荐阅读
- google-chrome - 使用浏览器时忽略应用引擎标准防火墙规则,但使用 curl 时不会
- html - 如何在不添加额外容器的情况下以包含 html 的角度呈现变量?
- oracle - 如何将包括分区在内的完整表结构复制到oracle中的另一个表中?
- sql - SQL BigQuery 行到列
- c++ - 如何使用 PDFIUM c++ 保存 pdf
- c# - 如何在 MSAL .Net C# 中获取刷新令牌
- react-native - 反应本机按钮图标位置问题
- javascript - 如何从选择器中选择 json 文档?
- kubernetes - 无法创建 pod 沙箱:rpc 错误:code = Unknown desc = seccomp 在您的内核中未启用,无法使用配置文件运行
- java - Spring Cloud Gateway YML 路由 - 有没有办法检查权限?