Skip to content

Instantly share code, notes, and snippets.

View ReginFell's full-sized avatar
🎯
Focusing

Serhii Zabelnykov ReginFell

🎯
Focusing
  • Amsterdam, Netherlands
View GitHub Profile
analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
void main() async {
var what1 = getFuture();
var what2 = getString();
// what1 is dynamic, what2 is string
}
getFuture() {
return Future.value(1);
}
analyzer:
strong-mode:
implicit-casts: false
Unhandled Exception: type 'Future<dynamic>' is not a subtype of type 'Future<String>'
Future<dynamic> getFuture() {
return Future.value(int);
}
Future<String> why() {
return getFuture();
}
void main() async {
await why();
}
type 'MappedListIterable<dynamic, int>' is not a subtype of type 'List<int>'
type 'MappedListIterable<dynamic, int>' is not a subtype of type 'List<int>'
final List<String> first = ["one", "two"];
final List<int> second = first.map((value) => value.hashCode);
print(second);
@ReginFell
ReginFell / input.dart
Last active December 19, 2019 18:30
fff
final List<String> collectionOfStrings = ["one", "two"];
final List<int> collectionOfInts = collectionOfStrings.map((value) => value.hashCode);
private fun handleFailedAttempt() {
attempts++
saveFailedAttemptsData()
if (attempts >= 5) {
if (!timerRunning) {
startTimer()
}
when {
attempts == 5 -> resetTime(ATTEMPT_FIVE_TIME)
attempts == 6 -> resetTime(ATTEMPT_SIX_TIME)