File: dart

package info (click to toggle)
ruby-rouge 4.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,836 kB
  • sloc: ruby: 38,168; sed: 2,071; perl: 152; makefile: 8
file content (60 lines) | stat: -rw-r--r-- 844 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// comment
/*
multiline
comment
*/


library dart_example;
import 'package:http/http.dart' as http;
import "dart:io" show HttpClient, RedirectInfo;
part 'foo.dart';
part of bar;

var str = 'Test';
String str2 = "Test";
String strWithNewline = "test\n";
String multiline = '''
this
is
multiline string
''';
var rawString = r"raw string";
var stringWithInterpolation = 'Value: $value';
var expressionInString = 'Value: ${value + 1}';

var symbol = #symbol;

assert(str == str2);
final x = 10;
const y = 500 * x;
var hex = 0xff;
double z = 1.22e-17;

fun(num x) {
  print('The argument is x');
}

class A {
  @override
  void fooMethod {
  }
}


class B {
}

class C extends A implements B {
}

void main() {
  var collection=[1,2,3,4,5];
  for(var a in collection) {
    if (a != 7) {
      print(a);
    } else {
      print(a + 1);
    }
  }
}