Skip to content

Instantly share code, notes, and snippets.

import 'package:bloc/bloc.dart';
class SomeState {
final bool isLoading;
final int data;
SomeState({this.isLoading = false, this.data = 0});
SomeState copyWith({bool isLoading, int data}) {
return SomeState(
class SomeState {
int counter = 0;
Stream<int> stream() async* {
yield counter += 1;
yield counter += 1;
print('at the end of stream counter is $counter');
}
}
@lbv
lbv / gist:87aa07d4f187743ef8ad
Created August 15, 2014 21:09
LitJSON patched mapper, by @oddgames-david
// Originally from: https://github.com/lbv/litjson/pull/7#issuecomment-28179440
#region Header
/**
* JsonMapper.cs
* JSON to .Net object and object to JSON conversions.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
@lbv
lbv / pandoc.css
Last active December 17, 2015 13:49
Stylesheet for pandoc-generated HTML
body {
color: #222;
font-family: Droid Sans, Verdana, sans-serif;
font-size: 100%;
line-height: 140%;
margin: auto;
max-width: 48em;
padding-right: 1em;
padding-left: 1em;
}
@lbv
lbv / tango-colors.js
Last active December 15, 2015 20:19
Tango colors
/**
* Palette of basic colors, based on the Tango Icon Theme
* Guidelines.
*/
// In hexadecimal
var $colors = {
yellow : [ 0xfce94f, 0xedd400, 0xc4a000 ],
orange : [ 0xfcaf3e, 0xf57900, 0xce5c00 ],
brown : [ 0xe9b96e, 0xc17d11, 0x8f5902 ],