This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final iterable = [1].map((x) => x * 2); | |
x(iterable); | |
} | |
void x(List<int> ints) { | |
print('Hello'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding=utf8 | |
import re | |
import io | |
import os | |
import sys | |
regex = r"(<[^>]+href=\"#([^>]+)\"[^<]*>)[^\3]*(<[^>]+id=\"\2\"[^<]*>)" | |
pattern = re.compile(regex) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/widgets.dart'; | |
typedef AdjustPanChildBuilder = Widget Function(EdgeInsetsGeometry padding); | |
/// A widget that forces the same behavior as | |
/// Android's `adjustPan` windowSoftInputMode. | |
/// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BitmapDescriptor _stationPin; | |
ui.Image _clusterBgImage; | |
Future<BitmapDescriptor> _getClusterBitmap( | |
BuildContext context, | |
MapCluster cluster, | |
) async { | |
if (!cluster.isCluster && _stationPin != null) { | |
return _stationPin; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef EnumMapperCallback<T, E> = T Function(E value); | |
class EnumMapper<E, T> { | |
EnumMapper(List<E> enumValues, EnumMapperCallback<T, E> mapper) { | |
for (final enumValue in enumValues) { | |
final key = enumValue; | |
final value = mapper(enumValue); | |
_forwardMap[key] = value; | |
_inverseMap[value] = key; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
const lineHeight = 27.0; | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> main() async { | |
await test(); | |
} | |
Future<void> test() async { | |
try { | |
return errorGenerator(); | |
} catch (e) { | |
print('!!!CAPTURED ERROR!!!'); | |
} finally { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> main() async { | |
await test(); | |
} | |
Future<void> test() async { | |
try { | |
return await errorGenerator(); | |
} catch (e) { | |
print('!!!CAPTURED ERROR!!!'); | |
} finally { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final di = DIContainer(); | |
final quarterExpenses1 = di.getComputeQuarterExpensesUseCase().perform(100000); | |
print(quarterExpenses1); | |
final quarterExpenses2 = di.getComputeQuarterExpensesUseCaseFunction()(100000); | |
print(quarterExpenses2); | |
final quarterExpenses3 = di.getExplicitComputeQuarterExpensesUseCaseFunction()(100000); | |
print(quarterExpenses3); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
void main() { | |
fn1(); | |
scheduleMicrotask(() { | |
print('microtask after fn1'); | |
}); | |
fn2(); | |
scheduleMicrotask(() { | |
print('microtask after fn2'); |