Friday, September 18, 2020

Flutter, Hallo World!

Flutter...

What is Flutter??.. Flutter is i don't know maybe about framework or something.. Flutter is based by Dart Language. And my first experience with Dart language its pretty similar with Javascript in my opinion. Other said Dart is like Java, Javascript and Python. Flutter and dart it self is developed by Google.

And this afternoon i try to install Flutter in my computer.

My Programming language Background is PHP and Javascript. I ever Try build some apps with Angular, but someone said there's problem in performance when deliver the apps that build with angular. So Flutter is the Solution for that. because Flutter has its own engine maybe like java with JRE. maybe you can search more deeper about it..

So this afternoon I have installed Flutter on my computer (actually on my office computer), and i think Flutter is cool. I try developing and running my apps on my phone (Xiaomi) and it runs well with hot reload. These are some documentation about what I've done when installed flutter..

  1. Download Flutter (https://flutter.dev/docs/get-started/install)
  2. After Download extract the rar/zip file and copy to drive C, so it become C:/flutter, in some documentation said that don't put flutter on Program File folder (in windows OS).
  3. After that we need to add the flutter path to environment variable path, so it can be called any where in windows terminal, so add the path of flutter bin (C/:flutter/bin/) to environment variable. You can Search by typing environment variable in windows search and after you find it hit enter.


  4. In system properties click environment variable.
  5. In Environment Variable find variable path on user variable and edit.
  6. Add the flutter bin path to variable path, with new button and paste flutter bin path on that.
  7. hit oke

For now you can run flutter command on any path on your terminal. after that you need to install android studio, after you install android studio you need to add some plugin (fultter and dart plugin). For me, I'm Using Visual Studio Code to code flutter, so I just need to install flutter and dart plugin on that IDE, and you can create flutter project on terminal, this the steps:
  1. Open a new folder for your project in VSCode.
  2. open the VSCode terminal and type: flutter create myfirstapp.
  3. flutter will create flutter demo project for you, so you ar ready to code now.



By the way how to run the code? you can use emulator for that or you can use real android device.
just type flutter run. I'm using real android device to run my code, coz when run in emulator it slowing down computer speed. so these are what I've done setting up my xiomi device maybe it will be vary in another device.
  1. We need to enable developer option. With go to settings, and chose About phone.
  2. And then hit couple time in MIUI version until you get a "You are now a Developer" notificaition or something.
  3. When the "developer" notification is shown, you can go to Additional Settings to enter in Developer Option menu.
  4. Search for USB debuging, set it on,
  5. Install via USB, set it on, and
  6. MIUI optimization, set it on
Now you can run your flutter code on your device by connecting it with usb cable. You just hit F5 button to run and hit reload it.

If you cant run your apps, try run flutter doctor -v to check

Thats all Thanks, God Bless u..

No comments:

Post a Comment