{"id":25855589,"url":"https://github.com/mwaijega/dart","last_synced_at":"2025-03-01T17:19:22.940Z","repository":{"id":274829642,"uuid":"868060663","full_name":"mwaijega/Dart","owner":"mwaijega","description":"These are basics of Dart  programming language","archived":false,"fork":false,"pushed_at":"2025-02-09T19:30:42.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T20:28:01.427Z","etag":null,"topics":["dart","programming"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwaijega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-05T11:26:05.000Z","updated_at":"2025-02-09T19:30:45.000Z","dependencies_parsed_at":"2025-01-29T16:38:13.103Z","dependency_job_id":"f2344f38-4525-4593-be46-d69da04e7f35","html_url":"https://github.com/mwaijega/Dart","commit_stats":null,"previous_names":["mwaijega/dart"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwaijega%2FDart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwaijega%2FDart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwaijega%2FDart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwaijega%2FDart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwaijega","download_url":"https://codeload.github.com/mwaijega/Dart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241397046,"owners_count":19956466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","programming"],"created_at":"2025-03-01T17:19:22.385Z","updated_at":"2025-03-01T17:19:22.933Z","avatar_url":"https://github.com/mwaijega.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# 🎯 Dart Basics Repository\n\nWelcome to the **Dart Basics** repository! This repository is designed to help you get started with Dart, a powerful language used for building web, mobile, and desktop applications. 🚀\n\n## 📂 Repository Structure\n\n- `hello_world.dart`: A simple \"Hello, World!\" program.\n- `variables.dart`: Learn about Dart variables and data types.\n- `functions.dart`: Basic function usage and examples.\n- `control_flow.dart`: Control structures like `if-else`, loops, and more.\n- `classes_objects.dart`: Introduction to object-oriented programming in Dart.\n\n## 🛠️ How to Run the Code\n\n1. Make sure you have the Dart SDK installed. [Install here](https://dart.dev/get-dart).\n2. Clone this repository:\n\n```bash\ngit clone https://github.com/ministerko/Dart.git\ncd dart-basics\n```\n\n3. Run a specific Dart file:\n\n```bash\ndart run hello_world.dart\n```\n\n## 📚 Dart Basics\n\n### 1. **Variables** 📦\n\nVariables in Dart can be declared with `var` or by specifying the type explicitly:\n\n```dart\nvar name = 'Kelvin'; // Inferred as String\nint age = 25;        // Explicit type declaration\n```\n\n### 2. **Functions** 🔧\n\nFunctions can return values or just perform actions:\n\n```dart\nvoid greet() {\n  print('Hello, Dart! 👋');\n}\n\nint add(int a, int b) {\n  return a + b;\n}\n```\n\n### 3. **Control Flow** 🔄\n\n#### `if-else`:\n\n```dart\nint age = 20;\n\nif (age \u003e= 18) {\n  print('You are an adult! 🎉');\n} else {\n  print('You are still a minor. 🌱');\n}\n```\n\n#### `for` loop:\n\n```dart\nfor (int i = 0; i \u003c 5; i++) {\n  print('Dart is awesome! 😎');\n}\n```\n\n### 4. **Classes \u0026 Objects** 👨‍💻\n\nDart supports object-oriented programming with classes:\n\n```dart\nclass Person {\n  String name;\n  int age;\n\n  // Constructor\n  Person(this.name, this.age);\n\n  void displayInfo() {\n    print('Name: $name');\n    print('Age: $age');\n  }\n}\n\nvoid main() {\n  Person person1 = Person('Kelvin', 25);\n  person1.displayInfo();\n}\n```\n\n### 5. **Null Safety** 🚫\n\nDart ensures null safety, so you have to initialize non-nullable variables:\n\n```dart\nString name = 'Kelvin'; // Cannot be null\n```\n\nIf a variable can be null, you use a nullable type:\n\n```dart\nString? optionalName;\noptionalName = null; // Allowed\n```\n\n## 🔗 Resources\n\n- [Official Dart Documentation](https://dart.dev/)\n- [DartPad (Online Playground)](https://dartpad.dev/)\n- [Flutter (Mobile App Framework)](https://flutter.dev/)\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwaijega%2Fdart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwaijega%2Fdart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwaijega%2Fdart/lists"}