CMIContent Marketing InstituteContent directory

News · General · Archive

CodeMirror: Dart mode

Home News

.CodeMirror {border: 1px solid #dee;}

CodeMirror

Home Manual Code

Language modes Dart

Dart mode

import 'dart:math' show Random;

void main() { print(new Die(n: 12).roll()); }

// Define a class. class Die { // Define a class variable. static Random shaker = new Random();

// Define instance variables. int sides, value;

// Define a method using shorthand syntax. String toString() => '$value';

// Define a constructor. Die({int n: 6}) { if (4

var editor = CodeMirror.fromTextArea(document.getElementById("code"), { lineNumbers: true, mode: "application/dart" });

More in Archive · More in General · More in News