Search packages, repositories and app categories

GitHub repositoryYusukeIwaki/dart-kotlin_flavor

dart-kotlin_flavor

YusukeIwaki/dart-kotlin_flavor open-source repository details.

dart-kotlin_flavor project cover
Stars
30
Forks
0
Last push (UTC)
Apr 1, 2021
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

Dart CI Pub

kotlin_flavor

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;
  });
}

kotlin_flavor/scope_functions

let

Often used for executing a code block only with non-null values.

someNullable?.let((it) { ... });
also

Used for additional actions that don't alter the object, such as logging or printing debug information.

something.also((it) { ... }); // returns something.
run

Used for evaluating a block of several statements where an expression is required.

someNullable ?? run(() {
  var defaultValue = ......;
  // several process...

  return defaultValue;
});

Development

$ 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
Yusuke Iwaki GitHub avatar
GitHub author

Yusuke Iwaki ↗

Fukuoka, JapanOfficial website ↗
LanguagesDart

Packages published by this repository

Dependencies used

Dependency list 2 items

  • pedanticDevelopment^1.10.0
  • testDevelopment^1.16.6

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗