├── bin ├── module_2 │ ├── test.dart │ ├── 10_pub_packages.dart │ ├── NamaFile.dart │ ├── nama_file.dart │ ├── 0_extension.dart │ ├── 11_calculator.dart │ ├── 5_loops.dart │ ├── 3_operator.dart │ ├── 2_nullsafety.dart │ ├── 1_variable_datatype.dart │ ├── 4_control_flow.dart │ ├── 7_anonimous_function.dart │ ├── 9_enumeration.dart │ ├── 8_collection.dart │ └── 6_function.dart ├── module_3 │ ├── copy │ │ ├── 4_error_handling.dart │ │ ├── 11_extension.dart │ │ ├── 3_future_basic.dart │ │ ├── 2_stream_basic.dart │ │ ├── 8_generic.dart │ │ ├── 5_inheritance.dart │ │ ├── 9_factory.dart │ │ ├── 10_equality.dart │ │ ├── 7_mixin.dart │ │ ├── 6_abstract.dart │ │ └── 1_basic_class.dart │ ├── tabungan.dart │ ├── bank.dart │ ├── inheritance.dart │ ├── PostModel.dart │ ├── abstract.dart │ └── basic_class.dart ├── nullsafety.dart └── dart_basic_aston.dart ├── CHANGELOG.md ├── config.json ├── README.md ├── .gitignore ├── pubspec.yaml ├── analysis_options.yaml └── pubspec.lock /bin/module_2/test.dart: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version. 4 | -------------------------------------------------------------------------------- /bin/module_2/10_pub_packages.dart: -------------------------------------------------------------------------------- 1 | // intl 2 | // riverpod -------------------------------------------------------------------------------- /bin/module_2/NamaFile.dart: -------------------------------------------------------------------------------- 1 | class NamaFile{ 2 | 3 | } -------------------------------------------------------------------------------- /bin/module_2/nama_file.dart: -------------------------------------------------------------------------------- 1 | class NamaFile{ 2 | 3 | } -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": [ 3 | 4 | ] 5 | } -------------------------------------------------------------------------------- /bin/module_2/0_extension.dart: -------------------------------------------------------------------------------- 1 | // dart 2 | // flutter 3 | // error lens 4 | // pubspec assist 5 | // vscode-icon -------------------------------------------------------------------------------- /bin/module_2/11_calculator.dart: -------------------------------------------------------------------------------- 1 | //tugas, buat aplikasi kalkulator sederhana 2 | //do while 3 | //if 4 | //function 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/module_3/copy/4_error_handling.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | try{ 3 | final myInt = int.parse('abc'); 4 | }on FormatException { 5 | print('gagal format'); 6 | } 7 | } 8 | 9 | class MyCustomError extends Error { 10 | 11 | } -------------------------------------------------------------------------------- /bin/module_2/5_loops.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | for (int i = 0; i < 10; i++) { 3 | print(i); 4 | } 5 | 6 | 7 | 8 | bool condition = true; 9 | while (condition) { 10 | 11 | } 12 | 13 | do { 14 | print('hello'); 15 | } while (false); 16 | } 17 | -------------------------------------------------------------------------------- /bin/nullsafety.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | String? myString; 3 | // myString = 'bahri'; 4 | print(myString); 5 | 6 | String? name; 7 | 8 | if(myString == null){ 9 | 10 | }else { 11 | 12 | } 13 | 14 | bool isEnable = 10 == 6+5; 15 | 16 | bool isOk; 17 | isOk = 10 == 1+1; 18 | 19 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dart_basic_aston 2 | description: A sample command-line application. 3 | version: 1.0.0 4 | # homepage: https://www.example.com 5 | environment: 6 | sdk: '>=2.18.0 <3.0.0' 7 | 8 | # dependencies: 9 | # path: ^1.8.0 10 | dev_dependencies: 11 | lints: ^2.0.0 12 | test: ^1.16.0 13 | dependencies: 14 | http: ^0.13.5 15 | -------------------------------------------------------------------------------- /bin/module_2/3_operator.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | int result; 3 | double resultDouble = 5/5; 4 | result = 5 ~/ 5; 5 | 6 | int x = 5; 7 | x++; 8 | x--; 9 | x=x+5; 10 | x+=5; 11 | x-=5; 12 | x*=5; 13 | // x/=5; 14 | x~/=5; 15 | 16 | bool isEqual = 5==10; 17 | 18 | String myString ='Hello world $isEqual'; 19 | 20 | String myString2 ='Hello world ${1+2+4}'; 21 | 22 | 23 | } -------------------------------------------------------------------------------- /bin/module_2/2_nullsafety.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | // var myString = 'Hello world'; 3 | // // myString = 5; 4 | // print(myString); 5 | // myString = 'Update'; 6 | 7 | // final String myString ='init'; 8 | // myString = 'Update'; 9 | 10 | // String myString; 11 | // print(myString); 12 | 13 | // String impossible = null; 14 | // impossible.length; 15 | 16 | String? impossible = 'abc'; 17 | print(impossible.length); 18 | } -------------------------------------------------------------------------------- /bin/module_3/copy/11_extension.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | final x = 'hello'.tambahKataSayang(); 3 | 'hallo'.contains('h'); 4 | print(x); 5 | } 6 | 7 | extension StringDuplocation on String { 8 | String duplication() { 9 | return this + this; 10 | } 11 | 12 | String hurufBesar() { 13 | print('ini untuk conversi ke huruf besar '); 14 | return this.toUpperCase(); 15 | } 16 | 17 | String tambahKataSayang(){ 18 | return this + ' sayang'; 19 | } 20 | } -------------------------------------------------------------------------------- /bin/module_2/1_variable_datatype.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | String myString = 'Hello world'; 3 | print(myString); 4 | print(myString.contains('Hello')); 5 | 6 | int myInteger = 5; 7 | int _myPrivate = 10; 8 | int myPrivate = _myPrivate; 9 | print(myInteger); 10 | print(myInteger.isEven); 11 | double myDouble = 5.5; 12 | 13 | num myNumber = 6.5; 14 | 15 | bool myBool = true; 16 | 17 | dynamic mySomething = null; 18 | 19 | mySomething = 'something'; 20 | mySomething = false; 21 | } -------------------------------------------------------------------------------- /bin/module_2/4_control_flow.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | final myInteger = 5; 3 | if (myInteger == 10) { 4 | print('it\'s ten'); 5 | } else if (myInteger == 9) { 6 | print('its nine'); 7 | } else if (myInteger <= 20) { 8 | print('Greater than twenty'); 9 | } else { 10 | print('oh, it is something else'); 11 | } 12 | 13 | switch (myInteger) { 14 | case 10: 15 | print('its ten'); 16 | break; 17 | case 9: 18 | print('its nine'); 19 | break; 20 | default: 21 | print('default'); 22 | break; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bin/module_3/copy/3_future_basic.dart: -------------------------------------------------------------------------------- 1 | import 'package:http/http.dart'; 2 | 3 | void main(List args) async { 4 | Future futureResult = Client().get( 5 | Uri.parse('https://jsonplaceholder.typicode.com/todos'), 6 | ); 7 | String nilaiLangsung = 'langsung'; 8 | 9 | Response result = await futureResult; 10 | 11 | print(result.body); 12 | 13 | Client() 14 | .get( 15 | Uri.parse('https://jsonplacehol11der.typicqqode.com/todos'), 16 | ) 17 | .then((value) => print(value.body)) 18 | .catchError((e) => print('error $e')); 19 | } 20 | -------------------------------------------------------------------------------- /bin/module_3/tabungan.dart: -------------------------------------------------------------------------------- 1 | class Tabungan { 2 | late int _saldo; 3 | 4 | Tabungan(int setoranAwal) { 5 | _saldo = setoranAwal; 6 | } 7 | 8 | int get saldo => _saldo; 9 | 10 | set setor(int setor) { 11 | _saldo += setor; 12 | } 13 | 14 | set setorTapiDikit(int dikit) {} 15 | 16 | int getSaldo() => _saldo; 17 | 18 | void setSetor(int nominal) { 19 | _saldo += nominal; 20 | } 21 | 22 | bool ambilTunai(int nominal) { 23 | if (_saldo >= nominal) { 24 | _saldo -= nominal; 25 | return true; 26 | } 27 | return false; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /bin/module_2/7_anonimous_function.dart: -------------------------------------------------------------------------------- 1 | import '6_function.dart'; 2 | 3 | void main(List args) { 4 | 5 | cumaPrintAja('print dari tempat lain'); 6 | 7 | 8 | // named function 9 | void pressThreeDBuddy() { 10 | print('Pressing a 3D Buddy.'); 11 | } 12 | // calling a function 13 | pressThreeDBuddy(); 14 | // output: Pressing a 3D Buddy. 15 | 16 | // anonymous function 17 | Function anonymous; 18 | anonymous = () { 19 | print('Pressing anonymously.'); 20 | }; 21 | // calling an anonymous function 22 | anonymous(); 23 | // output: Pressing anonymously. 24 | } 25 | 26 | -------------------------------------------------------------------------------- /bin/module_3/bank.dart: -------------------------------------------------------------------------------- 1 | import 'tabungan.dart'; 2 | 3 | void main(List args) { 4 | Tabungan tabungan = Tabungan(50000); 5 | print('get saldo java version: ${tabungan.getSaldo()}'); 6 | print('get saldo dart version: ${tabungan.saldo}'); 7 | 8 | print('mau stor tunai 70.000'); 9 | tabungan.setor = 70000; 10 | tabungan.setSetor(70000); 11 | 12 | print('get saldo dart version: ${tabungan.saldo}'); 13 | 14 | print('ambil tunai 200.000'); 15 | bool isSuccess = tabungan.ambilTunai(190000); 16 | 17 | print('ambil dana : ${isSuccess ? 'Sukses' : 'Gagal'}'); 18 | 19 | print('get saldo dart version: ${tabungan.saldo}'); 20 | } 21 | -------------------------------------------------------------------------------- /bin/module_3/copy/2_stream_basic.dart: -------------------------------------------------------------------------------- 1 | Future main(List args) async { 2 | final myPeriodicStream = Stream.periodic(const Duration(seconds: 1)); 3 | final subscription = myPeriodicStream.listen((event) { 4 | print('a second has passed'); 5 | }); 6 | await Future.delayed(const Duration(seconds: 10)); 7 | subscription.cancel(); 8 | 9 | createMessageStream().map((message) => message.toUpperCase()).listen((event) { 10 | print(event); 11 | }); 12 | } 13 | 14 | Stream createMessageStream() async* { 15 | yield 'hello'; 16 | await Future.delayed(const Duration(seconds: 1)); 17 | yield 'have you heard of..'; 18 | await Future.delayed(const Duration(seconds: 1)); 19 | yield 'Flutter'; 20 | } 21 | -------------------------------------------------------------------------------- /bin/module_3/copy/8_generic.dart: -------------------------------------------------------------------------------- 1 | import '6_abstract.dart'; 2 | 3 | void main(List args) { 4 | 5 | } 6 | 7 | 8 | abstract class DataReader { 9 | T readData(); 10 | 11 | } 12 | 13 | class StringDataReader implements DataReader { 14 | @override 15 | String readData() { 16 | print('performing logic'); 17 | return 'Yes oke'; 18 | } 19 | 20 | } 21 | 22 | class AdminDataReader implements DataReader { 23 | @override 24 | Admin readData() { 25 | print('performing logic'); 26 | return Admin(specialAdminField: 2, firstName: 'saiful', lastName: 'bahri'); 27 | } 28 | 29 | } 30 | 31 | class IntegerDataReader implements DataReader { 32 | @override 33 | int readData() { 34 | // TODO: implement readData 35 | return 123; 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /bin/module_2/9_enumeration.dart: -------------------------------------------------------------------------------- 1 | enum AccountType { free, premium, vip } 2 | 3 | enum StatusPengiriman {pickup, process, delivered } //delivery, delivery, 4 | 5 | Data pengiriman = Data(status: StatusPengiriman.delivered); 6 | // paymentStatus = StatusPayment.paid; 7 | class Data { 8 | StatusPengiriman status; 9 | Data({ 10 | required this.status, 11 | }); 12 | } 13 | 14 | void main(List args) { 15 | final userAccountType = AccountType.premium; 16 | print(userAccountType.index); 17 | AccountType.values[1]; 18 | 19 | switch (userAccountType) { 20 | case AccountType.free: 21 | print('Rp 0'); 22 | break; 23 | case AccountType.premium: 24 | print('Rp 100.000'); 25 | break; 26 | case AccountType.vip: 27 | print('Rp 200.000'); 28 | break; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bin/module_3/inheritance.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | 3 | } 4 | 5 | class RegularClass{ 6 | final int myField; 7 | 8 | RegularClass(this.myField); 9 | 10 | int get publicProperty => 123; 11 | 12 | String getSomething(){ 13 | return 'Hello'; 14 | } 15 | } 16 | 17 | class OtherClass implements RegularClass { 18 | @override 19 | String getSomething() { 20 | // TODO: implement getSomething 21 | throw UnimplementedError(); 22 | } 23 | 24 | @override 25 | // TODO: implement myField 26 | int get myField => throw UnimplementedError(); 27 | 28 | @override 29 | // TODO: implement publicProperty 30 | int get publicProperty => throw UnimplementedError(); 31 | 32 | } 33 | 34 | abstract class DataReader { 35 | String readData(); 36 | } 37 | 38 | class LongReadData implements DataReader { 39 | @override 40 | String readData() { 41 | print('performing logic'); 42 | return 'Yes oke'; 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /bin/module_3/copy/5_inheritance.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | 3 | } 4 | 5 | class RegularClass{ 6 | final int myField; 7 | 8 | RegularClass(this.myField); 9 | 10 | int get publicProperty => 123; 11 | 12 | String getSomething(){ 13 | return 'Hello'; 14 | } 15 | } 16 | 17 | class OtherClass implements RegularClass { 18 | @override 19 | String getSomething() { 20 | // TODO: implement getSomething 21 | throw UnimplementedError(); 22 | } 23 | 24 | @override 25 | // TODO: implement myField 26 | int get myField => throw UnimplementedError(); 27 | 28 | @override 29 | // TODO: implement publicProperty 30 | int get publicProperty => throw UnimplementedError(); 31 | 32 | } 33 | 34 | abstract class DataReader { 35 | String readData(); 36 | } 37 | 38 | class LongReadData implements DataReader { 39 | @override 40 | String readData() { 41 | print('performing logic'); 42 | return 'Yes oke'; 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /bin/module_3/PostModel.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:convert'; 3 | 4 | List dataListFromJson(String str) => List.from(json.decode(str).map((x) => DataList.fromJson(x))); 5 | 6 | String dataListToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); 7 | 8 | class DataList { 9 | DataList({ 10 | required this.userId, 11 | required this.id, 12 | required this.title, 13 | required this.body, 14 | }); 15 | 16 | final int userId; 17 | final int id; 18 | final String title; 19 | final String body; 20 | 21 | factory DataList.fromJson(Map json) => DataList( 22 | userId: json["userId"] ?? '', 23 | id: json["id"] ?? '', 24 | title: json["title"] ?? '', 25 | body: json["body"] ?? '', 26 | ); 27 | 28 | Map toJson() => { 29 | "userId": userId, 30 | "id": id, 31 | "title": title, 32 | "body": body, 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /bin/module_3/copy/9_factory.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | 3 | } 4 | 5 | class Admin extends User3 { 6 | final double specialAdminField; 7 | 8 | Admin({ 9 | required this.specialAdminField, 10 | required String firstName, 11 | required String lastName, 12 | }) : super(firstName, lastName); 13 | 14 | @override 15 | String get fullName => 'Admin: ${super.fullName}'; 16 | 17 | @override 18 | void signOut() { 19 | print('admin specifc sign out'); 20 | super.signOut(); 21 | } 22 | } 23 | 24 | class User3 { 25 | final String _firstName; 26 | final String _lastName; 27 | const User3( 28 | this._firstName, 29 | this._lastName, 30 | ); 31 | 32 | factory User3.admin(bool admin) { 33 | // return 'hehehe'; 34 | return admin 35 | ? Admin( 36 | specialAdminField: 1111, 37 | firstName: 'admin', 38 | lastName: 'gudang', 39 | ) 40 | : User3( 41 | 'user', 42 | 'biasa', 43 | ); 44 | } 45 | 46 | String get fullName => '$_firstName $_lastName'; 47 | 48 | void signOut() { 49 | print('sign out'); 50 | } 51 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bin/module_3/copy/10_equality.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | 3 | } 4 | 5 | class User2 { 6 | String? name; 7 | String? youtubeChannel; 8 | int? id; 9 | String? _private; 10 | String? _email; 11 | User2( 12 | int this.id, { 13 | this.name, 14 | this.youtubeChannel, 15 | required String private, 16 | }) : _private = private; 17 | 18 | String? get private => _private; 19 | String? getPrivate() => _private; 20 | 21 | void setEmail(String value) { 22 | _email = value; 23 | } 24 | 25 | set email(String value) { 26 | _email = value; 27 | } 28 | 29 | void signOut() { 30 | print('sign out'); 31 | } 32 | 33 | @override 34 | bool operator ==(Object other) { 35 | if (identical(this, other)) return true; 36 | 37 | return other is User2 && 38 | other.name == name && 39 | other.youtubeChannel == youtubeChannel && 40 | other.id == id && 41 | other._private == _private && 42 | other._email == _email; 43 | } 44 | 45 | @override 46 | int get hashCode { 47 | return name.hashCode ^ 48 | youtubeChannel.hashCode ^ 49 | id.hashCode ^ 50 | _private.hashCode ^ 51 | _email.hashCode; 52 | } 53 | } -------------------------------------------------------------------------------- /bin/module_3/copy/7_mixin.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | Admin newAdmin = Admin(specialAdminField: 1, firstName: 'saiful', lastName: 'bahri'); 3 | newAdmin.sendElevatedMessage('halo'); 4 | } 5 | 6 | mixin ElevatedClient { 7 | void sendElevatedMessage(String text) { 8 | print('sending a message with an elavated importance: $text'); 9 | } 10 | } 11 | 12 | class Admin extends User3 with ElevatedClient{ 13 | final double specialAdminField; 14 | 15 | Admin({ 16 | required this.specialAdminField, 17 | required String firstName, 18 | required String lastName, 19 | }) : super(firstName, lastName); 20 | 21 | @override 22 | String get fullName => 'Admin: ${super.fullName}'; 23 | 24 | @override 25 | void signOut() { 26 | print('admin specifc sign out'); 27 | super.signOut(); 28 | } 29 | } 30 | 31 | class User3 { 32 | final String _firstName; 33 | final String _lastName; 34 | const User3( 35 | this._firstName, 36 | this._lastName, 37 | ); 38 | 39 | factory User3.admin(bool admin) { 40 | // return 'hehehe'; 41 | return admin 42 | ? Admin( 43 | specialAdminField: 1111, 44 | firstName: 'admin', 45 | lastName: 'gudang', 46 | ) 47 | : User3( 48 | 'user', 49 | 'biasa', 50 | ); 51 | } 52 | 53 | String get fullName => '$_firstName $_lastName'; 54 | 55 | void signOut() { 56 | print('sign out'); 57 | } 58 | } -------------------------------------------------------------------------------- /bin/module_2/8_collection.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | List myList = [1, 2, 4]; 3 | 4 | final list = [true, true, false]; 5 | 6 | list[0]; 7 | 8 | ['aku', 'sehat']; 9 | 10 | final firstElement = myList[0]; 11 | 12 | // List myList2 = [1,2,4, 'hello']; 13 | 14 | [1, 2, 3]; 15 | 16 | Map myMap = { 17 | 'name': 'Budiman', 18 | 'age': 30, 19 | 'registered': true, 20 | }; 21 | 22 | final name = myMap['name']; 23 | 24 | Set mySet = {1, 2, 3, 3, 3}; 25 | print(mySet.length); 26 | 27 | final names = ['budi', 'angga', 'yantimah']; 28 | 29 | final nameLengths = names.map((e) => e.length).toList(); 30 | nameLengths[0]; 31 | 32 | final nameFiltered = names.where((e) => e.length == 4).toList(); 33 | 34 | print(nameFiltered); 35 | 36 | for (int i = 0; i < nameFiltered.length; i++) { 37 | print(nameFiltered[i]); 38 | } 39 | 40 | for (final name in nameFiltered) { 41 | print(name); 42 | } 43 | 44 | nameFiltered.forEach((element) { 45 | print('i'); 46 | print('i'); 47 | print(element); 48 | }); 49 | 50 | nameFiltered.forEach((element) => print(element)); 51 | 52 | nameFiltered.forEach((element) => print); 53 | 54 | [ 55 | 'this is a fake content', 56 | if (true) 'sign out' else 'sign in', 57 | ]; 58 | 59 | final list1 = ['hello', 'there']; 60 | final list2 = ['what', 'up']; 61 | 62 | final result = [ 63 | ...list1, 64 | ...list2, 65 | ]; 66 | 67 | print(result); 68 | } 69 | -------------------------------------------------------------------------------- /bin/module_2/6_function.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | String returnStringNested() { 3 | return 'hello Nested'; 4 | } 5 | 6 | cumaPrintAja('lalala'); 7 | 8 | returnStringNested(); 9 | _returnString(); 10 | print(_returnString()); 11 | 12 | int plusFive(int x){ 13 | return x+5; 14 | } 15 | 16 | final twiceFive = twice((x){ 17 | return x+ 5; 18 | }); 19 | 20 | final twiceFive2 = twice((x) => x+5); 21 | final twicePlusFive = twice(plusFive); 22 | 23 | final result = twicePlusFive(3); 24 | 25 | print(result); 26 | 27 | print((plusFive(3))); 28 | } 29 | 30 | String _returnString() { 31 | return 'hello'; 32 | } 33 | 34 | int penambahan(int a, int b){ 35 | return a+b; 36 | } 37 | 38 | void cumaPrintAja(String value){ 39 | print(value); 40 | } 41 | 42 | void otherFunction() { 43 | _returnString(); 44 | // returnStringNested(); error 45 | } 46 | 47 | void positionalParams(int x, int y, String greeting) { 48 | positionalParams(4, 5, 'Helloo'); 49 | } 50 | 51 | void optionalPositionParams(int x, double y, [String? greeting]) { 52 | optionalPositionParams(2, 3.3); 53 | optionalPositionParams(3, 3.4, 'hhhoooo'); 54 | } 55 | 56 | void namedOptionalParams( 57 | String name, 58 | { 59 | required int x, 60 | double? y, 61 | String greeting = 'Hiii...', 62 | }) { 63 | namedOptionalParams( 64 | 'bahri', 65 | x: 2, 66 | ); 67 | 68 | namedOptionalParams( 69 | 'bahri', 70 | x: 2, 71 | y: null, 72 | ); 73 | 74 | namedOptionalParams( 75 | 'bahri', 76 | x: 4, 77 | y: 3.3, 78 | greeting: 'hallo', 79 | ); 80 | 81 | 82 | } 83 | 84 | int Function(int) twice(int Function(int) f){ 85 | return (int x) { 86 | return f(f(x)); 87 | }; 88 | } 89 | -------------------------------------------------------------------------------- /bin/dart_basic_aston.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | void main(List arguments) { 4 | print('Hello world PT Aston'); 5 | String name = 'Contoh variable'; 6 | print('length is: ${name.length + 20 - 2 * 5}'); 7 | print('length is: ${name}'); 8 | if (name.isNotEmpty) { 9 | print('name is not empty'); 10 | } 11 | 12 | if (name.isNotEmpty) { 13 | if (name == 'saya') { 14 | name.contains('variable'); 15 | name.split(':'); 16 | name.toUpperCase(); 17 | } 18 | } 19 | String firstName = 'Saiful'; 20 | String lastName = 'Bahri'; 21 | String fullName = '$firstName $lastName'; 22 | String fullName2 = '$firstName $lastName'; 23 | print(fullName); 24 | print(fullName2); 25 | 26 | dynamic myVar = 'yes'; 27 | // myVar =2; 28 | myVar = ''; 29 | myVar = 1; 30 | int myInt = 10; 31 | double myDouble = 10.0; 32 | 33 | myInt = 11; 34 | // myInt = 11.2; 35 | 36 | bool isEnable = true; 37 | isEnable = false; 38 | 39 | dynamic myDynamic = 'halo'; 40 | myDynamic = 12; 41 | myDynamic = true; 42 | 43 | Object myObject = 'String'; 44 | myObject = 12; 45 | 46 | myDouble = 10; 47 | 48 | const num myNum = 10; 49 | // myNum = 11.2; 50 | } 51 | 52 | Data myData = Data( 53 | id: 1, 54 | name: 'bahri', 55 | address: 'jepara', 56 | ); 57 | 58 | class Data { 59 | final int? id; 60 | final String? name; 61 | final String address; 62 | const Data({ 63 | required this.id, 64 | required this.name, 65 | required this.address, 66 | }); 67 | 68 | Map toMap() { 69 | return { 70 | 'id': id, 71 | 'name': name, 72 | 'address': address, 73 | }; 74 | } 75 | 76 | factory Data.fromMap(Map map) { 77 | return Data( 78 | id: map['id']?.toInt() ?? 0, 79 | name: map['name'] ?? '', 80 | address: map['address'] ?? '', 81 | ); 82 | } 83 | 84 | String toJson() => json.encode(toMap()); 85 | 86 | factory Data.fromJson(String source) => Data.fromMap(json.decode(source)); 87 | } 88 | -------------------------------------------------------------------------------- /bin/module_3/abstract.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | Admin admin = Admin( 3 | specialAdminField: 1, 4 | firstName: 'saiful', 5 | lastName: 'bahri', 6 | ); 7 | 8 | DbOracle ocr = DbOracle(); 9 | ocr.connectServer(); 10 | 11 | Database mysql = DbMySql(); 12 | } 13 | 14 | class Admin extends User3 { 15 | final double specialAdminField; 16 | 17 | bool _isLogin = false; 18 | 19 | Admin({ 20 | required this.specialAdminField, 21 | required String firstName, 22 | required String lastName, 23 | }) : super(firstName, lastName); 24 | 25 | @override 26 | String get fullName => 'Admin: ${super.fullName}'; 27 | 28 | @override 29 | void signOut() { 30 | print('admin specifc sign out'); 31 | super.signOut(); 32 | } 33 | 34 | @override 35 | bool get isLogin => _isLogin; 36 | 37 | @override 38 | void login() { 39 | _isLogin = true; 40 | } 41 | } 42 | 43 | abstract class User3 { 44 | final String _firstName; 45 | final String _lastName; 46 | const User3( 47 | this._firstName, 48 | this._lastName, 49 | ); 50 | 51 | String get fullName => '$_firstName $_lastName'; 52 | 53 | void signOut() { 54 | print('sign out'); 55 | } 56 | 57 | void login(); 58 | 59 | void login2() {} 60 | 61 | bool get isLogin; 62 | } 63 | 64 | abstract class Database { 65 | void connectServer() { 66 | print('connect server'); 67 | } 68 | 69 | String getData(); 70 | } 71 | 72 | class DbMySql extends Database { 73 | @override 74 | String getData() { 75 | return 'ini get data khusus untuk mysql'; 76 | } 77 | } 78 | 79 | class DbOracle extends Database { 80 | @override 81 | String getData() { 82 | return 'ini get data khusus untuk oracle'; 83 | } 84 | 85 | // @override 86 | // void connectServer() { 87 | // print('ini log sebelum masuk ke server oracle'); 88 | // super.connectServer(); 89 | // } 90 | 91 | } 92 | 93 | abstract class Pickup { 94 | String? namaMuatan; 95 | Pickup(this.namaMuatan); 96 | 97 | String get supir; 98 | set tambahMuatan(String tambahan); 99 | } 100 | 101 | class AngkutanBuah extends Pickup { 102 | AngkutanBuah(super.namaMuatan); 103 | 104 | @override 105 | set tambahMuatan(String muatan) { 106 | namaMuatan = '$namaMuatan $muatan'; 107 | } 108 | 109 | @override 110 | String get supir => 'jono'; 111 | } 112 | -------------------------------------------------------------------------------- /bin/module_3/copy/6_abstract.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | Admin admin = Admin( 3 | specialAdminField: 1, 4 | firstName: 'saiful', 5 | lastName: 'bahri', 6 | ); 7 | 8 | DbOracle ocr = DbOracle(); 9 | ocr.connectServer(); 10 | 11 | Database mysql = DbMySql(); 12 | } 13 | 14 | class Admin extends User3 { 15 | final double specialAdminField; 16 | 17 | bool _isLogin = false; 18 | 19 | Admin({ 20 | required this.specialAdminField, 21 | required String firstName, 22 | required String lastName, 23 | }) : super(firstName, lastName); 24 | 25 | @override 26 | String get fullName => 'Admin: ${super.fullName}'; 27 | 28 | @override 29 | void signOut() { 30 | print('admin specifc sign out'); 31 | super.signOut(); 32 | } 33 | 34 | @override 35 | bool get isLogin => _isLogin; 36 | 37 | @override 38 | void login() { 39 | _isLogin = true; 40 | } 41 | } 42 | 43 | abstract class User3 { 44 | final String _firstName; 45 | final String _lastName; 46 | const User3( 47 | this._firstName, 48 | this._lastName, 49 | ); 50 | 51 | String get fullName => '$_firstName $_lastName'; 52 | 53 | void signOut() { 54 | print('sign out'); 55 | } 56 | 57 | void login(); 58 | 59 | void login2() {} 60 | 61 | bool get isLogin; 62 | } 63 | 64 | abstract class Database { 65 | void connectServer() { 66 | print('connect server'); 67 | } 68 | 69 | String getData(); 70 | } 71 | 72 | class DbMySql implements Database { 73 | @override 74 | String getData() { 75 | return 'ini get data khusus untuk mysql'; 76 | } 77 | 78 | @override 79 | void connectServer() { 80 | print('wajib ditulis ulang'); 81 | } 82 | } 83 | 84 | class DbOracle extends Database { 85 | @override 86 | String getData() { 87 | return 'ini get data khusus untuk oracle'; 88 | } 89 | 90 | // @override 91 | // void connectServer() { 92 | // print('ini log sebelum masuk ke server oracle'); 93 | // super.connectServer(); 94 | // } 95 | 96 | } 97 | 98 | abstract class Pickup { 99 | String? namaMuatan; 100 | Pickup(this.namaMuatan); 101 | 102 | String get supir; 103 | set tambahMuatan(String tambahan); 104 | } 105 | 106 | class AngkutanBuah extends Pickup { 107 | AngkutanBuah(super.namaMuatan); 108 | 109 | @override 110 | set tambahMuatan(String muatan) { 111 | namaMuatan = '$namaMuatan $muatan'; 112 | } 113 | 114 | @override 115 | String get supir => 'jono'; 116 | } 117 | -------------------------------------------------------------------------------- /bin/module_3/copy/1_basic_class.dart: -------------------------------------------------------------------------------- 1 | void main(List args) { 2 | // String myLiteral = 'string here'; 3 | 4 | // [1, 2, 3]; 5 | 6 | // User myUser = User('a', 'b'); 7 | // final myUser2 = User('c', 'd'); 8 | // myUser2.name = 'saiful'; 9 | // final myUser3 = User('cahyo', 'adi'); 10 | // print(myUser.youtubeChannel); 11 | 12 | final user1 = User( 13 | name: 'bahri', 14 | youtubeChannel: 'code with bahri', 15 | ); 16 | 17 | final user2 = const User( 18 | name: 'bahri', 19 | youtubeChannel: 'code with bahri', 20 | ); 21 | 22 | final testUser2 = User2(1, private: 'private'); 23 | final testUser21 = User2(1, private: 'private 2'); 24 | print(testUser2 == testUser21); 25 | testUser2.setEmail('lala@gmail.com'); 26 | testUser2.email = 'oke@gmail.com'; 27 | testUser2.getPrivate(); 28 | testUser2.private; 29 | 30 | // print(user1 == user2); 31 | 32 | final admin = Admin( 33 | specialAdminField: 123, 34 | firstName: 'saiful', 35 | lastName: 'bahri', 36 | ); 37 | 38 | final user = admin as User3; 39 | print(user.fullName); 40 | 41 | final newAdmin = User3.admin(true); 42 | } 43 | 44 | class User { 45 | final String name; 46 | final String youtubeChannel; 47 | const User({ 48 | required this.name, 49 | required this.youtubeChannel, 50 | }); 51 | 52 | bool hasLongName() { 53 | return name.length > 10; 54 | } 55 | 56 | static void myMethod() {} 57 | 58 | static const minNameLength = 3; 59 | } 60 | 61 | class User2 { 62 | String? name; 63 | String? youtubeChannel; 64 | int? id; 65 | String? _private; 66 | String? _email; 67 | User2( 68 | int this.id, { 69 | this.name, 70 | this.youtubeChannel, 71 | required String private, 72 | }) : _private = private; 73 | 74 | String? get private => _private; 75 | String? getPrivate() => _private; 76 | 77 | void setEmail(String value) { 78 | _email = value; 79 | } 80 | 81 | set email(String value) { 82 | _email = value; 83 | } 84 | 85 | void signOut() { 86 | print('sign out'); 87 | } 88 | 89 | @override 90 | bool operator ==(Object other) { 91 | if (identical(this, other)) return true; 92 | 93 | return other is User2 && 94 | other.name == name && 95 | other.youtubeChannel == youtubeChannel && 96 | other.id == id && 97 | other._private == _private && 98 | other._email == _email; 99 | } 100 | 101 | @override 102 | int get hashCode { 103 | return name.hashCode ^ 104 | youtubeChannel.hashCode ^ 105 | id.hashCode ^ 106 | _private.hashCode ^ 107 | _email.hashCode; 108 | } 109 | } 110 | 111 | class Admin extends User3 { 112 | final double specialAdminField; 113 | 114 | Admin({ 115 | required this.specialAdminField, 116 | required String firstName, 117 | required String lastName, 118 | }) : super(firstName, lastName); 119 | 120 | @override 121 | String get fullName => 'Admin: ${super.fullName}'; 122 | 123 | @override 124 | void signOut() { 125 | print('admin specifc sign out'); 126 | super.signOut(); 127 | } 128 | } 129 | 130 | class User3 { 131 | final String _firstName; 132 | final String _lastName; 133 | const User3( 134 | this._firstName, 135 | this._lastName, 136 | ); 137 | 138 | factory User3.admin(bool admin) { 139 | // return 'hehehe'; 140 | return admin 141 | ? Admin( 142 | specialAdminField: 1111, 143 | firstName: 'admin', 144 | lastName: 'gudang', 145 | ) 146 | : User3( 147 | 'user', 148 | 'biasa', 149 | ); 150 | } 151 | 152 | String get fullName => '$_firstName $_lastName'; 153 | 154 | void signOut() { 155 | print('sign out'); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /bin/module_3/basic_class.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | void main(List args) { 4 | // User user1 = User( 5 | // nama: 'bahri', 6 | // nomortelp: '23432432', 7 | // alamat: 'jepara', 8 | // ); 9 | 10 | // User user3 = User( 11 | // nama: 'bahri saiful bahri', 12 | // nomortelp: '23432432', 13 | // alamat: 'jepara', 14 | // ); 15 | 16 | // print(user3.hasLongName()); 17 | 18 | // User user2 = user1.copyWith( 19 | // nomortelp: '111222111', 20 | // ); 21 | 22 | // print(user1 == user3); 23 | // print(user2); 24 | 25 | User user3 = User( 26 | nama: 'bahri saiful bahri', 27 | nomortelp: '23432432', 28 | alamat: 'jepara', 29 | email: 'bahri@gmail.com'); 30 | 31 | print(user3.getEmail()); 32 | print(user3.nomortelp); 33 | print(user3.email); 34 | user3.setEmail('halo@bahri.com'); 35 | user3.email = 'hallooo@bahri.com'; 36 | User.myMethod(true); 37 | 38 | Admin myAdmin = Admin( 39 | 3, 40 | nama: 'zainudin', 41 | alamat: 'kudus', 42 | noTelp: '2343243', 43 | email: 'kudus@gmail.com', 44 | ); 45 | 46 | print(myAdmin.name); 47 | } 48 | 49 | class User { 50 | final String nama; 51 | final String alamat; 52 | final String nomortelp; 53 | late String _email; 54 | User({ 55 | required this.nama, 56 | required this.alamat, 57 | required this.nomortelp, 58 | required String email, 59 | }) { 60 | _email = email; 61 | } 62 | 63 | factory User.admin(bool admin) { 64 | // return 'hehehe'; 65 | return admin 66 | ? Admin( 67 | 3, 68 | nama: 'zainudin', 69 | alamat: 'kudus', 70 | noTelp: '2343243', 71 | email: 'kudus@gmail.com', 72 | ) 73 | : User( 74 | nama: 'bahri saiful bahri', 75 | nomortelp: '23432432', 76 | alamat: 'jepara', 77 | email: 'bahri@gmail.com', 78 | ); 79 | } 80 | 81 | String get email => _email; 82 | 83 | String getEmail() => _email; 84 | 85 | void setEmail(String mail) => _email = mail; 86 | 87 | set email(String mail) => _email = mail; 88 | 89 | bool hasLongName() => nama.length > 10; 90 | 91 | static void myMethod(bool isAdmin) { 92 | if (isAdmin) { 93 | print('your are admin'); 94 | } else { 95 | print('your just a member'); 96 | } 97 | } 98 | 99 | static const minNameLenght = 3; 100 | 101 | @override 102 | String toString() => 103 | 'User(nama: $nama, alamat: $alamat, nomortelp: $nomortelp)'; 104 | 105 | // User copyWith({ 106 | // String? nama, 107 | // String? alamat, 108 | // String? nomortelp, 109 | // }) { 110 | // return User( 111 | // nama: nama ?? this.nama, 112 | // alamat: alamat ?? this.alamat, 113 | // nomortelp: nomortelp ?? this.nomortelp, 114 | // ); 115 | // } 116 | 117 | // Map toMap() { 118 | // return { 119 | // 'nama': nama, 120 | // 'alamat': alamat, 121 | // 'nomortelp': nomortelp, 122 | // }; 123 | // } 124 | 125 | // factory User.fromMap(Map map) { 126 | // return User( 127 | // nama: map['nama'] ?? '', // map['nama'] == null ? '' : map['nama'], 128 | // alamat: map['alamat'] ?? '', 129 | // nomortelp: map['nomortelp'] ?? '', 130 | // ); 131 | // } 132 | 133 | // String toJson() => json.encode(toMap()); 134 | 135 | // factory User.fromJson(String source) => User.fromMap(json.decode(source)); 136 | 137 | @override 138 | bool operator ==(Object other) { 139 | if (identical(this, other)) return true; 140 | 141 | return other is User && 142 | other.nama == nama && 143 | other.alamat == alamat && 144 | other.nomortelp == nomortelp; 145 | } 146 | 147 | @override 148 | int get hashCode => nama.hashCode ^ alamat.hashCode ^ nomortelp.hashCode; 149 | } 150 | 151 | class Admin extends User { 152 | final int adminAccess; 153 | 154 | Admin( 155 | this.adminAccess, { 156 | required String nama, 157 | required String alamat, 158 | required String noTelp, 159 | required String email, 160 | }) : super( 161 | nama: nama, 162 | alamat: alamat, 163 | nomortelp: noTelp, 164 | email: email, 165 | ); 166 | 167 | String get name => 'Admin name: ${super.nama}'; 168 | 169 | // Admin({ 170 | // required this.specialAdminField, 171 | // required String nama, 172 | // required String alamat, 173 | // }); 174 | 175 | } 176 | -------------------------------------------------------------------------------- /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: "47.0.0" 11 | analyzer: 12 | dependency: transitive 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "4.7.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.16.0" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "3.0.2" 53 | coverage: 54 | dependency: transitive 55 | description: 56 | name: coverage 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.6.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: "3.0.0" 81 | glob: 82 | dependency: transitive 83 | description: 84 | name: glob 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "2.1.0" 88 | http: 89 | dependency: "direct main" 90 | description: 91 | name: http 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "0.13.5" 95 | http_multi_server: 96 | dependency: transitive 97 | description: 98 | name: http_multi_server 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "3.2.1" 102 | http_parser: 103 | dependency: transitive 104 | description: 105 | name: http_parser 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "4.0.1" 109 | io: 110 | dependency: transitive 111 | description: 112 | name: io 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.0.3" 116 | js: 117 | dependency: transitive 118 | description: 119 | name: js 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "0.6.4" 123 | lints: 124 | dependency: "direct dev" 125 | description: 126 | name: lints 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "2.0.0" 130 | logging: 131 | dependency: transitive 132 | description: 133 | name: logging 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.0.2" 137 | matcher: 138 | dependency: transitive 139 | description: 140 | name: matcher 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "0.12.12" 144 | meta: 145 | dependency: transitive 146 | description: 147 | name: meta 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "1.8.0" 151 | mime: 152 | dependency: transitive 153 | description: 154 | name: mime 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "1.0.2" 158 | node_preamble: 159 | dependency: transitive 160 | description: 161 | name: node_preamble 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "2.0.1" 165 | package_config: 166 | dependency: transitive 167 | description: 168 | name: package_config 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "2.1.0" 172 | path: 173 | dependency: transitive 174 | description: 175 | name: path 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "1.8.2" 179 | pool: 180 | dependency: transitive 181 | description: 182 | name: pool 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "1.5.1" 186 | pub_semver: 187 | dependency: transitive 188 | description: 189 | name: pub_semver 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "2.1.1" 193 | shelf: 194 | dependency: transitive 195 | description: 196 | name: shelf 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "1.3.2" 200 | shelf_packages_handler: 201 | dependency: transitive 202 | description: 203 | name: shelf_packages_handler 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "3.0.1" 207 | shelf_static: 208 | dependency: transitive 209 | description: 210 | name: shelf_static 211 | url: "https://pub.dartlang.org" 212 | source: hosted 213 | version: "1.1.1" 214 | shelf_web_socket: 215 | dependency: transitive 216 | description: 217 | name: shelf_web_socket 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "1.0.2" 221 | source_map_stack_trace: 222 | dependency: transitive 223 | description: 224 | name: source_map_stack_trace 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "2.1.0" 228 | source_maps: 229 | dependency: transitive 230 | description: 231 | name: source_maps 232 | url: "https://pub.dartlang.org" 233 | source: hosted 234 | version: "0.10.10" 235 | source_span: 236 | dependency: transitive 237 | description: 238 | name: source_span 239 | url: "https://pub.dartlang.org" 240 | source: hosted 241 | version: "1.9.1" 242 | stack_trace: 243 | dependency: transitive 244 | description: 245 | name: stack_trace 246 | url: "https://pub.dartlang.org" 247 | source: hosted 248 | version: "1.10.0" 249 | stream_channel: 250 | dependency: transitive 251 | description: 252 | name: stream_channel 253 | url: "https://pub.dartlang.org" 254 | source: hosted 255 | version: "2.1.0" 256 | string_scanner: 257 | dependency: transitive 258 | description: 259 | name: string_scanner 260 | url: "https://pub.dartlang.org" 261 | source: hosted 262 | version: "1.1.1" 263 | term_glyph: 264 | dependency: transitive 265 | description: 266 | name: term_glyph 267 | url: "https://pub.dartlang.org" 268 | source: hosted 269 | version: "1.2.1" 270 | test: 271 | dependency: "direct dev" 272 | description: 273 | name: test 274 | url: "https://pub.dartlang.org" 275 | source: hosted 276 | version: "1.21.5" 277 | test_api: 278 | dependency: transitive 279 | description: 280 | name: test_api 281 | url: "https://pub.dartlang.org" 282 | source: hosted 283 | version: "0.4.13" 284 | test_core: 285 | dependency: transitive 286 | description: 287 | name: test_core 288 | url: "https://pub.dartlang.org" 289 | source: hosted 290 | version: "0.4.17" 291 | typed_data: 292 | dependency: transitive 293 | description: 294 | name: typed_data 295 | url: "https://pub.dartlang.org" 296 | source: hosted 297 | version: "1.3.1" 298 | vm_service: 299 | dependency: transitive 300 | description: 301 | name: vm_service 302 | url: "https://pub.dartlang.org" 303 | source: hosted 304 | version: "9.4.0" 305 | watcher: 306 | dependency: transitive 307 | description: 308 | name: watcher 309 | url: "https://pub.dartlang.org" 310 | source: hosted 311 | version: "1.0.1" 312 | web_socket_channel: 313 | dependency: transitive 314 | description: 315 | name: web_socket_channel 316 | url: "https://pub.dartlang.org" 317 | source: hosted 318 | version: "2.2.0" 319 | webkit_inspection_protocol: 320 | dependency: transitive 321 | description: 322 | name: webkit_inspection_protocol 323 | url: "https://pub.dartlang.org" 324 | source: hosted 325 | version: "1.2.0" 326 | yaml: 327 | dependency: transitive 328 | description: 329 | name: yaml 330 | url: "https://pub.dartlang.org" 331 | source: hosted 332 | version: "3.1.1" 333 | sdks: 334 | dart: ">=2.18.0 <3.0.0" 335 | --------------------------------------------------------------------------------