{"id":18621089,"url":"https://github.com/siddheshkukade/dart-demo-tutorial","last_synced_at":"2026-04-27T08:32:13.149Z","repository":{"id":114790204,"uuid":"496464154","full_name":"SiddheshKukade/dart-demo-tutorial","owner":"SiddheshKukade","description":"Just getting started with dart and this repo will contain the basic programs with dart and flutter concepts for @SiddheshKukade Contains a Dart Command Line Full Application","archived":false,"fork":false,"pushed_at":"2022-06-08T12:40:33.000Z","size":2121,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-17T04:35:26.248Z","etag":null,"topics":["console-application","dart","flutter-beginners"],"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/SiddheshKukade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-05-26T03:08:53.000Z","updated_at":"2024-03-19T01:28:24.000Z","dependencies_parsed_at":"2023-03-21T10:03:08.030Z","dependency_job_id":null,"html_url":"https://github.com/SiddheshKukade/dart-demo-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SiddheshKukade/dart-demo-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddheshKukade%2Fdart-demo-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddheshKukade%2Fdart-demo-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddheshKukade%2Fdart-demo-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddheshKukade%2Fdart-demo-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiddheshKukade","download_url":"https://codeload.github.com/SiddheshKukade/dart-demo-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddheshKukade%2Fdart-demo-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32329463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["console-application","dart","flutter-beginners"],"created_at":"2024-11-07T04:09:07.952Z","updated_at":"2026-04-27T08:32:13.108Z","avatar_url":"https://github.com/SiddheshKukade.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"A sample command-line application with an entrypoint in `bin/`, library code\nin `lib/`, and example unit test in `test/`.\n\n# Dart Project Structure [CONSOLE-FULL TEMPLATE]\n### there nothing like dart project exist there is only dart package refer project as package\n- `.dart_tool`  , .packages, pubspec.yaml , pubspec.lock files are associated with the packages\n- `lib` folder is realted to the libraries \n- `analysis_options.yaml` is related to the dart linting\n- `bin` - reserverd for command line apps just like this one \n- `.vscode` is for vscode configurations \n- `.README.md` , .gitignore , CHANGELOG.md , are for git source control \n\n# Packages in dart \n- Dart Package is main component of the dart ecosystem \n- (Pub.dev)[https://www.pub.dev] - a site where everyone comes and uploades thier own dart packages\n- You can use existing packages to implement common features like database connections \u0026 state management ,etc.\n- Application Pacakge is the package the will not be uploaded on the pub.dev \n- Library Pacakge is the package that will be uploaded on the pub.dev\n- Dart also has a pakcage manager that holds the job to manage all these pacakges which is known as `pub`\n- 'pubspec.yml' is like  `package.json` if you are coming from node js it is responsible for\n    - organizing the functionalities , and version of the pacakges \n    - We have to metion the `name` of the package sdk versio `dependancies` and `dev-dependacies` \n    - also contains a list of external packages that our packages depends on \n    - you can more infor about pacakges on (pub.dev)[https://pub.dev]\n    - ex. `pedantic` package is related to the linting topic and the  `test` packages is related to testing topic.\n- `pubspec.lock` and `pubspec.yaml` are genreated automatically when we run `dart pub get `\n- `.dart_tool/pub/package_cofig.json ` file contains the imports for the packages that are used in our project here is an example is \n```js\n  {\n      \"name\": \"_fe_analyzer_shared\",\n      \"rootUri\": \"file:///C:/Users/User/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/_fe_analyzer_shared-40.0.0\",\n      \"packageUri\": \"lib/\",\n      \"languageVersion\": \"2.12\"\n    },\n    // Our Pacakge is also listed on the bottom\n    {\n      \"name\": \"first\",\n      \"rootUri\": \"../\",\n      \"packageUri\": \"lib/\",\n      \"languageVersion\": \"2.16\"\n    }\n```\n- `.packages` file is deprecated version of the `.dart_tool/pub/pacakge_config.json` file\n- `pubspec.lock` file mainly links to the exact version of the package here's how it looks : \n```yml\npackages:\n  _fe_analyzer_shared:\n    dependency: transitive\n    description:\n      name: _fe_analyzer_shared\n      url: \"https://pub.dartlang.org\"\n    source: hosted\n    version: \"40.0.0\"\n  analyzer:\n    dependency: transitive\n    description:\n      name: analyzer\n      url: \"https://pub.dartlang.org\"\n    source: hosted\n    version: \"4.1.0\"\n```\n\u003chr/\u003e\n\n## Packages vs Libraries\n- Pacakge can contain one or more libraries \n- `lib` folder contains code publicly accessible to everyone meaning that if you upload your package on pub.dev then others can only use it's `lib `folder only other folders like `bin` will not be accessible \n- `lib` folder contains the implemetation for the package which is  publicly accessible once it is uplaoded on pub.dev \n\n\u003chr/\u003e\n\n# Dart Linting \n- used to check for warnings and errors\n- `pedantic` is one of the popular linting package contains the linting rules used by google for creating thier apps.\n- `analysis_options.yaml` is responsible for the specidifying the rules for linting\n- to see the depedancy code go to the vs code `DEPENDACIES` section\n- \n![image](https://user-images.githubusercontent.com/65951872/170520357-f1bb1730-1d50-40f9-84c0-6815d3b94a88.png)\n\n- `very-good-analyzer ` is also another linting pacakage used by \u003cb\u003every-good ventures \u003c/b\u003e\n\n# Dart Tests \n- Ideally for every feature and Functionality we should have a test checking functionality to prove it's robusness.\n- `/test` folder in dart contains all the testing code.\n- Unit tests can be executed from code editor or from the dart cli\n- `dart test` is command to run all the tests.\n\n# Execution and Compilation of Dart Programs \n## Dart Running Workflew\n### Dev Phase :\n- Fast \u0026 Stable Developement Workflow\n- Quick Analayzer \u0026 Reformatting tools\n- Fast Compilation and Recompilation\n- Code Optimization Techniques\n- Intuitive Debugging tools\n\n### Prod Phase :\n- Focused primarily on UX \n- Fast Startup time\n- Usefulness , reliability, stability\n- Good-lookingness , Interactivity\n- Testing in real world scenarios\n\n### Dart VM - Provides the execution environment for the dart apps , for production dart also uses a strip down version of dart vm for improved performance\n- any code inside the vm runs on an isolated environment\n- it is also known as isolated dart universe \n- it has it's own heap memory for it;s own thread of control for mutators and helper threads\n- heap is a garbage collector managed memory storage for all the objects allocated by the    programs\n- garbage collector reclaims memory which was allocted to program but it is no longer referenced.\n\n#### Dart VM Executes the Source code in 2 ways : \n1. from `source ` by using `JIT/AOT` compiler\n - 1.1 Running the source code from JIT Compiler\n    - use `dart run ` command\n      -  the code goes to the dart vm but dart VM can only run kernel binaries `(.dill files)` [contains serialed kernal abstract syntax as well as kernel AST] kernel AST is based on intermediatery language such as dart  \n      - ![image](https://user-images.githubusercontent.com/65951872/170646710-ca81978e-65b7-43ea-8789-e08224fc856b.png)\n      - After running `dart run ` command : \n      ![image](https://user-images.githubusercontent.com/65951872/170647028-d52c0720-9ffb-4584-a6f2-96e19ad7a525.png)\n - 1.2 Running from source code using AOT Compiler :\n      - mainly used for prod env \n       ![image](https://user-images.githubusercontent.com/65951872/170648047-8a92fff5-6671-4ab0-a0df-3e15b2819970.png)\n        ![image](https://user-images.githubusercontent.com/65951872/170648193-fac15aeb-f5d1-4171-bdeb-d8faa0be8fd1.png)\n      - tfa removes unreachable methods \n      - replaces indirect virtual function calls to direct function calls.\n      - AOT is based on JIT but with added optimizations. \n      - to use AOT Compiler `dart compile exe .\\bin\\\u003cYOUR_PROJECT_NAME\u003e.dart`                     \n\n2. from Snapshots (jit, aot or kernel snapshots) \n![image](https://user-images.githubusercontent.com/65951872/170609184-56244f45-1349-48a3-8d11-c30f7ef2120a.png)\n\n### Snapshot : \n  - What is snapshot - it just contains efficient representation of the entities that are allocated to the dart VM heap memory. this heap is traversed just before calling the main function.\n  - It is optimized for faster startup times so insted of parsing the whole source again  \n  - basically the heap data is serialized in the snapshot file and it is then deserialized to heap memory again by the Dart VM to run it faster. \n    - 3 types of snapshot :\n    1. JIT Snapshot - contains all parsed ,classes and code during our training run\n      - training run - `dart compile jit-snapshot .\\bin\\first.dart` and `dart run .\\bin\\\u003cYOUR_PROJECT_NAME\u003e.dart` is faster than `dart run ` [50 % Time improvement.] \n    2. AOT Snapshot - Not uses training run . uses standard AOT Compilation approach so that the VM can directly run the snapshot without having to redo to the compilations and optimizations.\n    - difference between AOT Compilation \u0026 AOT Snapshot Compilation \n    - ![image](https://user-images.githubusercontent.com/65951872/170652218-23974ef9-b446-4b75-97c3-95afa53e5960.png)\n    - ![image](https://user-images.githubusercontent.com/65951872/170652299-67049e42-07cd-405b-b20e-e4474a14fd7d.png)\n \n    3. Kernel Snapshot - portable around all cpu ; dart vm still needs to compile this \n\n3. to see the corresponding kernel file : \n  `dart compile kernel .\\bin\\\u003cYOUR_PROJECT_NAME\u003e.dart` \n\n4. Once this kernel binary is loaded in VM then it is parsed into various programming entities like Classes , Fields , Procedure , libraries ,etc.\n\n5. this process is done in a LAZY way it parses basic information first and each pointer then points to the kernel binary so that later on it can continue parsing hence the name Just In Time Compiler. \n\n\n# Dart Pacakges \n### Dart Package is just a library containing   `pubspec.yml` file . it supports the follwing fields in it: \n![image](https://user-images.githubusercontent.com/65951872/170663146-a0a6efb9-500a-4d5b-9b53-c0b3e61b5c14.png)\n\n## Types of dependancies : \n1. Immediate Dependancies\n2. Transitive Dependancies\n3. Regular Dependacies - used for both prod and dev environment\n4. Dev Dependacies - only be used during the developement phase\n### Ex . if you pacakge depends on a and a -\u003e b and b-\u003e c (-\u003e means depends on) then a is immediate depedancy and b and c are transitive dependacies.\n\n# Dart Community uses semantic versioning for packages refer (semver.org)[https://www.semver.org]\n## Ways to specify version constriats \n1. Caret Syntax ^ `ex . ^1.2.3 , ^0.1.2`\n2. traditional syntax =  `ex.  \u003e=1.2.3 \u003c2.0.0 , \u003e=0.1.2 \u003c0.2.0`\n\n### Don't use caret syntax for SDK Constraint instead use traditional method \n\n## Alternatives for pub.dev \n- hosted pacakges on HTTP Servers \n- git packages\n- path packages - multiple realted pacakages ,ex. creating big app that depends on smaller pakcages\n- sdk source - packages that came along with the SDKs [currently flutter is only supported here ]\n\n### Packages are stored on a special folder on local machine which can be specified via setting PUB_CACHE Environment variable\n#### you can see this path on `package_config.json` file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddheshkukade%2Fdart-demo-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddheshkukade%2Fdart-demo-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddheshkukade%2Fdart-demo-tutorial/lists"}