v0.2.0
kotlin_flavor
一个用于提供类似 Kotlin 中静态扩展方法的工具包。
26喜欢 1590近 30 天下载130Pub 分数
AndroidiOSWebmacOSWindowsLinux
YusukeIwaki/dart-kotlin_flavor open-source repository details.
以下为英文项目原文快照,最新内容请访问 GitHub。
Are you Android-app engineer, and eager to use scope functions also in Dart?
Yes, kotlin_flavor/scope_functions provides it for you! :)
import 'package:kotlin_flavor/scope_functions.dart'
bool handle(Shop selectedShop) {
return selectedShop?.let((shop) {
navigateTo(shop.location);
return true;
}) ?? run(() {
navigateToDefaultPosition();
return false;
});
}
Often used for executing a code block only with non-null values.
someNullable?.let((it) { ... });
Used for additional actions that don't alter the object, such as logging or printing debug information.
something.also((it) { ... }); // returns something.
Used for evaluating a block of several statements where an expression is required.
someNullable ?? run(() {
var defaultValue = ......;
// several process...
return defaultValue;
});
$ docker-compose pull
$ docker-compose run --rm dart
will build a Dart development environment for you.
Ensure all test successfully pass, every after you change some codes:
$ pub run test
依赖清单 2 项
^1.10.0^1.16.6先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗