├── CHANGELOG.md ├── lib ├── dart_basic.dart ├── main_exemple.dart ├── object_class_example.dart ├── contoh.dart ├── condition_example.dart └── looping_example.dart ├── README.md ├── .gitignore ├── bin └── dart_basic.dart ├── test └── dart_basic_test.dart ├── pubspec.yaml ├── analysis_options.yaml └── pubspec.lock /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version. 4 | -------------------------------------------------------------------------------- /lib/dart_basic.dart: -------------------------------------------------------------------------------- 1 | int calculate() { 2 | return 6 * 7; 3 | } 4 | -------------------------------------------------------------------------------- /lib/main_exemple.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var meja = 'laptop'; 3 | print(meja); 4 | } 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A sample command-line application with an entrypoint in `bin/`, library code 2 | in `lib/`, and example unit test in `test/`. 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub. 2 | .dart_tool/ 3 | .packages 4 | 5 | # Conventional directory for build output. 6 | build/ 7 | -------------------------------------------------------------------------------- /bin/dart_basic.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_basic/dart_basic.dart' as dart_basic; 2 | 3 | void main(List arguments) { 4 | print('Hello world: ${dart_basic.calculate()}!'); 5 | } 6 | -------------------------------------------------------------------------------- /test/dart_basic_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_basic/dart_basic.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | test('calculate', () { 6 | expect(calculate(), 42); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dart_basic 2 | description: A sample command-line application. 3 | version: 1.0.0 4 | # homepage: https://www.example.com 5 | 6 | environment: 7 | sdk: '>=2.15.0-178.1.beta <3.0.0' 8 | 9 | 10 | # dependencies: 11 | # path: ^1.8.0 12 | 13 | dev_dependencies: 14 | lints: ^1.0.0 15 | test: ^1.16.0 16 | -------------------------------------------------------------------------------- /lib/object_class_example.dart: -------------------------------------------------------------------------------- 1 | class animal { 2 | String? name; 3 | int? numberOfLegs; 4 | int? lifeSpan; 5 | 6 | void display() { 7 | print('Animal Name : $name'); 8 | print('number of legs : $numberOfLegs'); 9 | print('Live Span : $lifeSpan'); 10 | } 11 | } 12 | 13 | void main() { 14 | animal kerbau = animal(); 15 | kerbau.name = 'ryo'; 16 | kerbau.numberOfLegs = 4; 17 | kerbau.lifeSpan = 19; 18 | kerbau.display(); 19 | } 20 | -------------------------------------------------------------------------------- /lib/contoh.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | String name = "Nirfanto Hutuji"; 3 | int umur = 18; 4 | switch (umur) { 5 | case 18: 6 | print("anda sudah bisa mengurus ktp"); 7 | break; 8 | case 19: 9 | print("anda sudah wajib ktp"); 10 | break; 11 | default: 12 | print("anda masih di bawah umur"); 13 | break; 14 | } 15 | 16 | // if (umur < 17) { 17 | // print("Anda masih di bawah umur"); 18 | // } else if (umur <= 17) { 19 | // print("Anda sudah bisa mengurus ktp"); 20 | // } else { 21 | // print("Anda sudah wajib punya ktp"); 22 | // } 23 | } 24 | -------------------------------------------------------------------------------- /lib/condition_example.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | const cuaca = Weather.sunny; 3 | switch (cuaca) { 4 | case Weather.cloudy: 5 | print("cloudy"); 6 | break; 7 | case Weather.snowy: 8 | print("dingin"); 9 | break; 10 | case Weather.sunny: 11 | print("panas"); 12 | break; 13 | case Weather.rainy: 14 | print("Hujan"); 15 | break; 16 | } 17 | } 18 | enum Weather { sunny, snowy, cloudy, rainy } 19 | // String name = "Nirfanto Hutuji"; 20 | // var tinggi = "160"; 21 | // var umur = "20"; 22 | 23 | // print('Nama : $name'); 24 | // print('Tingii : $tinggi'); 25 | // print('Umur : $umur'); 26 | -------------------------------------------------------------------------------- /lib/looping_example.dart: -------------------------------------------------------------------------------- 1 | // void main() { 2 | // // for (int i = 0; i <= 10; i++) { 3 | // // print('nama index ke-$i'); 4 | // // } 5 | 6 | // // List pemainBokep = ['sugiono', 'jordi', 'okita', 'ai']; 7 | // // pemainBokep.forEach((element) { 8 | // // print(element); 9 | // // }); 10 | 11 | // // for (String pemain in pemainBokep) { 12 | // // print('Artis Bokep Nama : $pemain'); 13 | // // } 14 | 15 | // printName(); 16 | // } 17 | 18 | // void printName() { 19 | // print('ismail'); 20 | // } 21 | 22 | void main(List args) { 23 | print(cekGenap(7)); 24 | final anonim = (String nicname) { 25 | String firstName = 'Fan'; 26 | return '$firstName $nicname'; 27 | }; 28 | print(anonim('Hutuji')); 29 | } 30 | 31 | bool cekGenap(int i) { 32 | return i % 2 == 0; 33 | } 34 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the static analysis results for your project (errors, 2 | # warnings, and lints). 3 | # 4 | # This enables the 'recommended' set of lints from `package:lints`. 5 | # This set helps identify many issues that may lead to problems when running 6 | # or consuming Dart code, and enforces writing Dart using a single, idiomatic 7 | # style and format. 8 | # 9 | # If you want a smaller set of lints you can change this to specify 10 | # 'package:lints/core.yaml'. These are just the most critical lints 11 | # (the recommended set includes the core lints). 12 | # The core lints are also what is used by pub.dev for scoring packages. 13 | 14 | include: package:lints/recommended.yaml 15 | 16 | # Uncomment the following section to specify additional rules. 17 | 18 | # linter: 19 | # rules: 20 | # - camel_case_types 21 | 22 | # analyzer: 23 | # exclude: 24 | # - path/to/excluded/files/** 25 | 26 | # For more information about the core and recommended set of lints, see 27 | # https://dart.dev/go/core-lints 28 | 29 | # For additional information about configuring this file, see 30 | # https://dart.dev/guides/language/analysis-options 31 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "39.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "4.0.0" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.3.1" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.9.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.17.0" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "3.1.0" 53 | coverage: 54 | dependency: transitive 55 | description: 56 | name: coverage 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.2.0" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "3.0.2" 67 | file: 68 | dependency: transitive 69 | description: 70 | name: file 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "6.1.4" 74 | frontend_server_client: 75 | dependency: transitive 76 | description: 77 | name: frontend_server_client 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "2.1.3" 81 | glob: 82 | dependency: transitive 83 | description: 84 | name: glob 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "2.0.2" 88 | http_multi_server: 89 | dependency: transitive 90 | description: 91 | name: http_multi_server 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "3.2.1" 95 | http_parser: 96 | dependency: transitive 97 | description: 98 | name: http_parser 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "4.0.2" 102 | io: 103 | dependency: transitive 104 | description: 105 | name: io 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.0.4" 109 | js: 110 | dependency: transitive 111 | description: 112 | name: js 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "0.6.3" 116 | lints: 117 | dependency: "direct dev" 118 | description: 119 | name: lints 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "1.0.1" 123 | logging: 124 | dependency: transitive 125 | description: 126 | name: logging 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.1.0" 130 | matcher: 131 | dependency: transitive 132 | description: 133 | name: matcher 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "0.12.12" 137 | meta: 138 | dependency: transitive 139 | description: 140 | name: meta 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "1.14.0" 144 | mime: 145 | dependency: transitive 146 | description: 147 | name: mime 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "1.0.3" 151 | node_preamble: 152 | dependency: transitive 153 | description: 154 | name: node_preamble 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "2.0.2" 158 | package_config: 159 | dependency: transitive 160 | description: 161 | name: package_config 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "2.1.0" 165 | path: 166 | dependency: transitive 167 | description: 168 | name: path 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "1.8.3" 172 | pool: 173 | dependency: transitive 174 | description: 175 | name: pool 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "1.5.1" 179 | pub_semver: 180 | dependency: transitive 181 | description: 182 | name: pub_semver 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "2.1.2" 186 | shelf: 187 | dependency: transitive 188 | description: 189 | name: shelf 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "1.2.0" 193 | shelf_packages_handler: 194 | dependency: transitive 195 | description: 196 | name: shelf_packages_handler 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "3.0.1" 200 | shelf_static: 201 | dependency: transitive 202 | description: 203 | name: shelf_static 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "1.1.1" 207 | shelf_web_socket: 208 | dependency: transitive 209 | description: 210 | name: shelf_web_socket 211 | url: "https://pub.dartlang.org" 212 | source: hosted 213 | version: "1.0.2" 214 | source_map_stack_trace: 215 | dependency: transitive 216 | description: 217 | name: source_map_stack_trace 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "2.1.1" 221 | source_maps: 222 | dependency: transitive 223 | description: 224 | name: source_maps 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "0.10.10" 228 | source_span: 229 | dependency: transitive 230 | description: 231 | name: source_span 232 | url: "https://pub.dartlang.org" 233 | source: hosted 234 | version: "1.9.1" 235 | stack_trace: 236 | dependency: transitive 237 | description: 238 | name: stack_trace 239 | url: "https://pub.dartlang.org" 240 | source: hosted 241 | version: "1.10.0" 242 | stream_channel: 243 | dependency: transitive 244 | description: 245 | name: stream_channel 246 | url: "https://pub.dartlang.org" 247 | source: hosted 248 | version: "2.1.1" 249 | string_scanner: 250 | dependency: transitive 251 | description: 252 | name: string_scanner 253 | url: "https://pub.dartlang.org" 254 | source: hosted 255 | version: "1.1.1" 256 | term_glyph: 257 | dependency: transitive 258 | description: 259 | name: term_glyph 260 | url: "https://pub.dartlang.org" 261 | source: hosted 262 | version: "1.2.1" 263 | test: 264 | dependency: "direct dev" 265 | description: 266 | name: test 267 | url: "https://pub.dartlang.org" 268 | source: hosted 269 | version: "1.21.4" 270 | test_api: 271 | dependency: transitive 272 | description: 273 | name: test_api 274 | url: "https://pub.dartlang.org" 275 | source: hosted 276 | version: "0.4.12" 277 | test_core: 278 | dependency: transitive 279 | description: 280 | name: test_core 281 | url: "https://pub.dartlang.org" 282 | source: hosted 283 | version: "0.4.16" 284 | typed_data: 285 | dependency: transitive 286 | description: 287 | name: typed_data 288 | url: "https://pub.dartlang.org" 289 | source: hosted 290 | version: "1.3.1" 291 | vm_service: 292 | dependency: transitive 293 | description: 294 | name: vm_service 295 | url: "https://pub.dartlang.org" 296 | source: hosted 297 | version: "8.2.2" 298 | watcher: 299 | dependency: transitive 300 | description: 301 | name: watcher 302 | url: "https://pub.dartlang.org" 303 | source: hosted 304 | version: "1.0.2" 305 | web_socket_channel: 306 | dependency: transitive 307 | description: 308 | name: web_socket_channel 309 | url: "https://pub.dartlang.org" 310 | source: hosted 311 | version: "2.3.0" 312 | webkit_inspection_protocol: 313 | dependency: transitive 314 | description: 315 | name: webkit_inspection_protocol 316 | url: "https://pub.dartlang.org" 317 | source: hosted 318 | version: "1.2.0" 319 | yaml: 320 | dependency: transitive 321 | description: 322 | name: yaml 323 | url: "https://pub.dartlang.org" 324 | source: hosted 325 | version: "3.1.1" 326 | sdks: 327 | dart: ">=2.15.0-178.1.beta <3.0.0" 328 | --------------------------------------------------------------------------------