nisrulz / flutter-examples

[Examples] Simple basic isolated apps, for budding flutter devs.
https://nisrulz.com/flutter-examples/
Apache License 2.0
6.97k stars 1.67k forks source link

chore: a easy way to get flutter packages #39

Closed psaren closed 5 years ago

psaren commented 5 years ago

This PR will let developer can get flutter packages of all project in just one command(by using nodejs)!

The following is the result of running the command!

$ node ./get_flutter_packages.js
D:\src\flutter_project\flutter-examples\dropdown_button get packages start...
D:\src\flutter_project\flutter-examples\enabling_splash_screen get packages start...
D:\src\flutter_project\flutter-examples\google_signin get packages start...
D:\src\flutter_project\flutter-examples\grid_layout get packages start...
D:\src\flutter_project\flutter-examples\handling_routes get packages start...
D:\src\flutter_project\flutter-examples\image_from_network get packages start...
D:\src\flutter_project\flutter-examples\infinite_list get packages start...
D:\src\flutter_project\flutter-examples\load_local_image get packages start...
D:\src\flutter_project\flutter-examples\load_local_json get packages start...
D:\src\flutter_project\flutter-examples\navigation_drawer get packages start...
D:\src\flutter_project\flutter-examples\persist_key_value get packages start...
D:\src\flutter_project\flutter-examples\simple_material_app get packages start...
D:\src\flutter_project\flutter-examples\stateful_widget get packages start...
D:\src\flutter_project\flutter-examples\stateless_widgets get packages start...
D:\src\flutter_project\flutter-examples\tip_calculator get packages start...
D:\src\flutter_project\flutter-examples\using_alert_dialog get packages start...
D:\src\flutter_project\flutter-examples\using_bottom_nav_bar get packages start...
D:\src\flutter_project\flutter-examples\using_custom_fonts get packages start...
D:\src\flutter_project\flutter-examples\using_edittext get packages start...
D:\src\flutter_project\flutter-examples\using_gradient get packages start...
D:\src\flutter_project\flutter-examples\using_http_get get packages start...
D:\src\flutter_project\flutter-examples\using_listview get packages start...
D:\src\flutter_project\flutter-examples\using_snackbar get packages start...
D:\src\flutter_project\flutter-examples\using_stepper get packages start...
D:\src\flutter_project\flutter-examples\using_tabs get packages start...
D:\src\flutter_project\flutter-examples\using_theme get packages start...
Running "flutter packages get" in enabling_splash_screen...         1.4s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in load_local_image...               1.4s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_custom_fonts...             1.2s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_stepper...                  1.2s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in grid_layout...                    1.1s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in infinite_list...                  0.6s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_gradient...                 0.6s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in google_signin...                  0.8s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in stateful_widget...                0.5s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_edittext...                 0.8s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_snackbar...                 1.4s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_http_get...                 0.8s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_tabs...                     0.7s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in tip_calculator...                 0.6s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in handling_routes...                0.6s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_listview...                 0.8s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in simple_material_app...            0.6s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in image_from_network...             0.8s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_bottom_nav_bar...           1.0s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in load_local_json...                1.0s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in dropdown_button...                0.7s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in persist_key_value...              0.8s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in navigation_drawer...              0.7s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_alert_dialog...             0.5s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in stateless_widgets...              0.5s

Waiting for another flutter command to release the startup lock...
Running "flutter packages get" in using_theme...                    0.6s

All project get flutter packages in 49.266 seconds
nisrulz commented 5 years ago

I don't think it is a good approach. Using Nodejs to run what one can do with a simple bash script.

Can you justify your solution here?

psaren commented 5 years ago

You are right! I just find dart extension can get all project flutter packages when open VScode. This PR is redundant.

nisrulz commented 5 years ago

@psaren I added a bash script to do exactly what you wanted to do with the nodejs version. If you still want to update all packages you can use the script as described here: https://github.com/nisrulz/flutter-examples#get-packages-for-all-flutter-projects

psaren commented 5 years ago

@nisrulz Awesome & Thanks! I was tried to do the some thing with bash script before, but I don't know much about bash script syntax.