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 ↗