我一直在尝试使用户登录并使用 dart 在 flutter 中注册 http。不知何故,我想让用户使用会话或 cookie 留在应用程序中。有人尝试过吗?
在Swift 4中使用PromiseKit进行API调用:
let apiCall = ApiManager.shared.fetchActors()
apiCall.then { actors -> Void in
self.dataSourceArray = actors
self.tableView.reloadData()
}.catch { error -> Void in
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
无法将类型(()->无效)的值转换为预期的参数类型'()-> _'
我该如何解决这个问题?
我有如下的正则表达式代码(我使用的是 VerbalExpression dart 插件),我的目的是检查字符串是否以“36”开头,后跟“01”、“02”或“03”。之后可以是任何内容,只要整个字符串长度为 16 个字符即可。
var regex = VerbalExpression()
..startOfLine()
..then("36")
..then("01")
..or("02")
..anythingBut(" ")
..endOfLine();
String nik1 = "3601999999999999";
String nik2 = "3602999999999999";
String nik3 = "3603999999999999";
print('result : ${regex.hasMatch(nik1)}');
print('Hasil : ${regex.hasMatch(nik2)}');
print('Hasil : ${regex.hasMatch(nik3)}');
Run Code Online (Sandbox Code Playgroud)
我的代码仅适用于 nik1 和 nik2,但是我希望 nik3 为 true,我注意到我不能将 or() 放在 or() 之后进行多次检查,它只会给我所有错误的结果,我该如何实现?
由于我的公司协议,我有不想发布到dart包的信息。如何仅将我的dart包用于我的公司而不在pub dart lang上显示?
我已经查看了此链接https://github.com/dart-lang/pub/issues/1050,但仍需要更多有关此信息。
我在github中有私人仓库,并在我的项目中将其用作软件包。在pubspec.yaml中,我这样写。
dependencies:
shared_preferences: ^0.4.3
atomic_app_customer_musteat_id:
git: git@github.com:organization/my_github_repo_ssh .git
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
Run Code Online (Sandbox Code Playgroud)
但是错误是“在我的github_repo中找不到名为“ pubspec.yaml”的文件”
我在我的帐户中添加了ssh,并尝试在github中配置机器用户。然后,我尝试将其更改为正常的https链接,并且没有错误。但是当我尝试在bitrise的ci / cd上构建并得到错误时。
pub get failed (69) -- attempting retry 5 in 16 seconds...
Git error. Command: git fetch
fatal: not a git repository
Run Code Online (Sandbox Code Playgroud)
但是仍然不知道如何解决这个问题。
我有像“080000000000”这样的字符串,意思是上午 8 点。所以,我使用格式 DateFormat('jm');
我尝试使用 DateTime.parse 对第 4 个字符串转换进行子字符串转换,但引发异常。
如何实现给定的字符串到上午 8 点?