Skip to content

Instantly share code, notes, and snippets.

View nickmeinhold's full-sized avatar

Nick Meinhold nickmeinhold

  • Melbourne, Australia
View GitHub Profile
This file has been truncated, but you can view the full file.
<source>
var Box2D = (() => {
var _scriptDir = import.meta.url;
return (
function(Box2D) {
Box2D = Box2D || {};
@nickmeinhold
nickmeinhold / hint.txt
Last active June 1, 2021 02:47
Exercise: Practice using async and await
You can do it!
@nickmeinhold
nickmeinhold / main.dart
Created September 5, 2019 13:57
hello_world with throw before runApp
import 'package:flutter/material.dart';
void main() {
throw ('hello');
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
@nickmeinhold
nickmeinhold / stream_from_iterable_emits_done.dart
Created August 25, 2019 13:05
A stream made from an iterable will emit the done event
void main() {
Stream.fromIterable([1,2]).listen(print, onDone: () => print('onDone'));
}
@nickmeinhold
nickmeinhold / streamcontroller_close_fires_oncancel_and_ondone.dart
Last active August 25, 2019 13:11
Closing a StreamController calls onCancel and emits done event
import 'dart:async';
void main() {
var controller;
controller = StreamController(onListen: () {
for (final number in [1, 2]) {
controller.add(number);
}
controller.close();
},