我正在寻找一种通过mailchimp API 3.0实现双重选择的舒适方式.看起来版本2.0中有一个选项告诉mailchimp在通过API调用添加新成员后立即自动发送选择确认电子邮件.
似乎此参数在API 3.0中不再可用.有谁知道如何使用新版本的API 实现它?
我尝试使用 ReorderableListView 小部件在 Flutter 中创建一个可重新排序的列表:
return ReorderableListView(
onReorder: (int index, int targetPosition) {
print(index.toString() + " -> " + targetPosition.toString());
}
...
Run Code Online (Sandbox Code Playgroud)
我找不到 onReorder 中的两个参数的确切解释。我找到了一些“oldIndex”、“newIndex”员工——但这看起来并不正确。
我已经用一个包含三个项目的列表构建了一个示例。当我拖动项目时,我得到以下(让我感到困惑)结果:
Position 1 -> Position 2 results in 0 -> 2
Position 1 -> Position 3 results in 0 -> 3
Position 3 -> Position 1 results in 2 -> 1
Run Code Online (Sandbox Code Playgroud)
对我来说,它看起来像是索引和位置的混合......
也许有人知道我的错误是什么?
I\xc2\xb4m 使用Angular 5和ngx-translate for i18n。现在我\xc2\xb4ve遇到以下问题,到目前为止还没有找到解决方案:
\n\n模板:
\n\nPlease <a routerlink="/signup">Signup now</a>!\nRun Code Online (Sandbox Code Playgroud)\n\n现在这个字符串应该通过翻译 json 文件进行翻译。但是routerlink没有被解析:
\n\nJson语言文件:
\n\n"signin": "Please <a routerlink="/signup">Signup now</a>!"\nRun Code Online (Sandbox Code Playgroud)\n\n我找到了一种解决方法,将句子分成三部分,但是 \xc2\xb4s 不是一个方便的方法,因为可能会发生三个部分与句子结构不匹配的情况(取决于语言)。
\n\n还有其他方法可以解决这个问题吗?
\n\n谢谢,最好的,\n迈克尔
\n我在Flutter(0.6)中的BottomNavigationBar遇到问题。一旦我添加了三个以上的BottomNavigationBarItems作为子项,栏中的按钮就会带有白色图标,并且它们被弄乱了。当我只使用三个或更少的物品时,一切都很好。
这是我使用的小部件代码,它打破了标准:
bottomNavigationBar: BottomNavigationBar(
currentIndex: 0,
iconSize: 20.0,
items: [
BottomNavigationBarItem(
title: Text('Home'), icon: Icon(Icons.accessibility)),
BottomNavigationBarItem(
title: Text('Preise'), icon: Icon(Icons.account_box)),
BottomNavigationBarItem(
title: Text('Test'), icon: Icon(Icons.adb)),
BottomNavigationBarItem(
title: Text('Mehr'), icon: Icon(Icons.menu))
])
Run Code Online (Sandbox Code Playgroud)
有人知道这里有什么问题吗?
预先感谢您的任何提示,迈克尔
我正在尝试使用 cloud_functions 包从我的 Flutter 应用程序调用 Google Cloud 函数。
这是我的云功能:
export const helloWorld = functions.region('europe-west1').https.onRequest((request, response) => {
response.status(200).json({
message: "Hello World!"
});
});
Run Code Online (Sandbox Code Playgroud)
这是我调用此函数的颤振方法:
try {
final dynamic resp =
await CloudFunctions.instance.call(
functionName: "helloWorld"
);
print(resp);
} on CloudFunctionsException catch (e) {
...
} catch (e) {
...
} finally {
...
}
Run Code Online (Sandbox Code Playgroud)
如您所见,这是最简单的请求形式,没有任何参数。
我的问题: 对 Cloud Function 的每次调用都会导致 CloudFunctionsException。原因:“响应不是有效的 JSON 对象。 ”。
也许有人知道这里出了什么问题?如果我通过 Postman 或浏览器调用云函数,将返回一个有效的 JSON 对象,并且不会抛出任何异常。
提前致谢,迈克尔
cloud json google-cloud-platform flutter google-cloud-functions
I\xc2\xb4m 使用SliverList和SliverChildBuilderDelegate来动态生成列表项。现在,我\xc2\xb4m 尝试允许用户通过拖放到一行中每个项目上的手柄图标来重新排序列表项目。
\n\n我\xc2\xb4ve尝试了不同的东西(比如Draggable Widget),但到目前为止我还没有\xc2\xb4t找到解决方案。有没有人已经使用 SliverList 小部件进行拖放重新排序并可以给我提示?
\n\n使用 ReorderableListView Widget 是不可能的,会导致将 ListView 混合到 SliverList。我想使用 SliverAppBar 来允许滚动时淡出效果,如下所示: https: //medium.com/flutter-io/slivers-demystified-6ff68ab0296f
\n\n这里\xc2\xb4s是我的SliverList的结构:
\n\nreturn Scaffold(\n body: RefreshIndicator(\n ...\n child: CustomScrollView(\n ...\n slivers: <Widget>[\n SliverAppBar(...),\n SliverList(\n delegate: SliverChildBuilderDelegate(...),\n )\n ...\nRun Code Online (Sandbox Code Playgroud)\n\n预先致谢,最好的,\n迈克尔
\n我正在尝试使用 Flutter/Dart 和 Firestore创建一个保存事务,它执行以下操作:
单个文档如下所示:
{
"title": "Some title",
"position": 1
}
Run Code Online (Sandbox Code Playgroud)
在文档(https://firebase.google.com/docs/firestore/manage-data/transactions)中,我找到了有关如何在单个文档上进行保存交易的说明,但没有找到有关如何创建此“两步- atomic-transaction”,我需要在集合中保存插入和更新。
也许有人对我有暗示?
更新: 感谢您的输入弗兰克。这是一个代码片段,希望能解释我想要实现的目标:
@override
Future addCatalogItem(CatalogItem catalogItem) {
return firestore.runTransaction((Transaction transaction) async {
// Update position (++) of existing catalogItems
await firestore
.collection(path)
.where("catalogId", isEqualTo: catalogItem.catalogId)
.snapshots()
.forEach((snapshot) {
snapshot.documents.forEach((document) {
// document.reference.updateData({"position": document.data["position"]});
transaction.update(document.reference, {"position": document.data["position"] + 1});
});
});
// Add the new catalogItem at position 1
await firestore
.collection(path)
.document(catalogItem.id)
.setData(catalogItem.toJson()); …Run Code Online (Sandbox Code Playgroud) 我对 dart 很陌生,想知道这个“包装”的功能到底是做什么的?它就像一个带有“connectUnits(userRepo)”的普通函数一样被调用:
void Function(
Store<AppState> store,
dynamic action,
NextDispatcher next,
) connectUnits(
UnitsRepository unitsRepository,
) {
return (store, action, next) {
unitsRepository.units().listen((units) {
store.dispatch(LoadUnitsAction(units));
next(action);
});
};
}
Run Code Online (Sandbox Code Playgroud)
谢谢 & 最好的,迈克尔
我想将以下字符串解析为PHP 中的 DateTime() 对象:
\n\n2017-03-03T09:06:41.187\nRun Code Online (Sandbox Code Playgroud)\n\n我尝试按如下方式执行此操作:
\n\n$stateCreatedOn = DateTime::createFromFormat('Y-m-dTH:i:s.u','2017-03-03T09:06:41.187');\nvar_dump($stateCreatedOn); // -> Returns false\nRun Code Online (Sandbox Code Playgroud)\n\n但是,解析不起作用,并且该变量始终设置为 false。有人知道我的日期格式规范有什么问题吗?
\n\n预先非常感谢!
\n我是一个多部分表单,混合了默认输入(文本,选择等)和文件上传(<input type="file">).
我正在使用表单验证类和Codeigniter上传库的组合来提交表单.这很好用.
对于我还没有找到解决方案的问题,我只有一个问题:如果用户选择了一个图像但是错过了填充另一个必填字段(如"name"),则表单验证类会阻止请求并显示错误消息给客户.
但现在我的问题是,图像已经成功提交,我不想让用户再次添加文件.所以我想用这些数据预先填充文件输入.
我尝试了不同的东西:
<input type="file" name="image" value="<?php echo set_value('image','');?>" />
Run Code Online (Sandbox Code Playgroud)
并且还花时间在网上寻找解决方案,但没有成功.
我在 Apache 2.4 中使用mod_security。在这个平台上,我们有一个电子商务系统,其管理工具使用以下 URL:
我想达到的目标:
不,“后端”不是物理存在的目录,它是一个 MVC 映射 :) 所以我正在寻找mod_rewrite 和 mod_security 之间的某种组合。
有人有什么想法吗?:)
提前致谢,迈克尔
我正在尝试将字符串(日期)从 RSS 提要(“pubDate”)转换为Swift 2 中的NSDate 对象。
let dateString:String = "Tue, 16 Aug 2016 15:27:33 +0000"
let dateFormatter = NSDateFormatter()
dateFormatter.dateStyle = NSDateFormatterStyle.ShortStyle
dateFormatter.dateFormat = "yyyy-MM-dd"
let date = dateFormatter.dateFromString(dateString)
print(date)
Run Code Online (Sandbox Code Playgroud)
问题是,在这种情况下,日期对象始终为 nil。问题是输入字符串的格式。如果我将 dateString 更改为“2016-08-16”,则NSDate 对象构建正确。
所以我不知道如何让这个 NSDate 工作。之前对dateString进行字符串操作?或者 dateFormatter 上的一些选项?
感谢您提前提供帮助!