start new:
tmux
start new with session name:
tmux new -s myname
#dart:convert example
How to pretty-print JSON using Dart.
How to display JSON in an easy-to-read (for human readers) format.
Main library: dart:convert
Main element: JsonEncoder.withIndent
Gist: https://gist.github.com/kasperpeulen/d61029fc0bc6cd104602
library mirrors.src.decode; | |
import 'dart:mirrors' as mirrors; | |
import 'dart:convert'; | |
/// Create an object of the given type [t] from the given JSON string. | |
decode(String json, Type t) { | |
// Get deserialization descriptor for the given type. | |
// This descriptor describes how to handle the type and all its fields. | |
final TypeDesc desc = getDesc(t); |
#include <assert.h> | |
#include <chrono> | |
#include <embedder.h> | |
#include <glfw3.h> | |
#include <iostream> | |
static_assert(FLUTTER_ENGINE_VERSION == 1, ""); | |
static const size_t kInitialWindowWidth = 800; |
import 'dart:math' show pi; | |
import 'package:flutter/material.dart'; | |
/// A Widget that can be configured to show funky spinning rectangles! | |
/// | |
/// ### Usage | |
/// | |
/// ``` | |
/// Spinnies( |
import 'package:flutter/material.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:vector_math/vector_math_64.dart' show radians; | |
void main() => runApp(ExampleApp()); | |
class ExampleItem { | |
static const Pineapples = ExampleItem._('Pineapples'); | |
static const Watermelons = ExampleItem._('Watermelons'); | |
static const StarFruit = ExampleItem._('Star Fruit'); |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
class DotsIndicator extends AnimatedWidget { | |
const DotsIndicator({ | |
@required this.controller, | |
@required this.itemCount, | |
@required this.onPageSelected, | |
this.color = Colors.white, |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:scanning_aimation/scanner.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
// MIT License | |
// | |
// Copyright (c) 2019 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |