This project sets up a CentOS 8 environment already provisioned with necessary to start using Flutter. It uses Vagrant and Ansible.
In this section we are going to show how to set up Git inside the environment (CentOS 8).
Within the project you have two variables to configure Git with your own data. These variables are:
- git_username
- git_user_email
You have to set these variables in /provision/ansible/gourp_vars/all/custom
.
Note 1: Don't use Spanish accent marks (this is not a must).
Example:
git_username: John Doe
git_user_email: [email protected]
Note 2: The following steps have to be done within the environment (CentOS 8).
Second thing to do is create a SSH pair keys. To do it run the following commands:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Note 1: When the command asks Enter file in which to save the key (/home/vagrant/.ssh/id_rsa):
just press "Enter".
Note 2: When the command asks Enter passphrase (empty for no passphrase):
leave it empty and press "Enter" twice so no passphrase will be set.
Full example below:
[vagrant@localhost ~]$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/vagrant/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/vagrant/.ssh/id_rsa.
Your public key has been saved in /home/vagrant/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:VjL4wS5q1FAM9DqFSpGQ3MMJbn4ZLt1fLWJnO85q9eU [email protected]
The key's randomart image is:
+---[RSA 4096]----+
|o+=o+o. |
|o..* +.o |
| o..+ + = . |
|o.o.+= o =. |
| o.=+.ooS= . |
| o. ooo=.o . |
| o ..o. o |
| . .o .. E |
| ...o |
+----[SHA256]-----+
Next thing to do is to add the SSH public key to your GitHub account. Let's go to https://github.com/ and log in.
Now go to Settings - SSH and GPG keys
and under SSH keys
choose New SSH key
. You will see a new window that asks you for a Title
and a Key
.
The Title
field is just to give a descriptive name to your SSH key and on the Key
field you have to paste your SSH public key. Finally just press "Add SSH key".
Note 3: To copy your SSH public key just run a cat
command of your SSH public key. In the example above within Create SSH keys is /home/vagrant/.ssh/id_rsa.pub.
.
Full example:
[vagrant@localhost ~]$ cat /home/vagrant/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC9ufBxlQD8BWoG9nsD9TUg41hbF+fR+9y0Iw3HWzq3iK/Heo4HZoUuuskjAPcYQABwvI4rw/4t7dApnI4LDhcIe/5q48IN3OnsiPwS9BvSDQTija+LsIGIQo/og3pCq5F2uwM8G3rrr9CljxGzr3mTRqWKFyGMS5E9+CUvsRrmmRW+B2bHZm6fjdO4CxDngS38I6XaMxvm4IDEf17FgFXf9Q8fLaWUgNpa2xE+fdI21mLN6iemG2OBQXxcvw2vpAPMHzbswmHouXZ/EGUCU+hvAtaLQAa3AB+M9B5JwaHBQv+nUXs9k9HihOW6u5JYM8cSCSMMAKoa2wr1b5jDE6Kj0GN0ALMYYwi4Lb+JZUf83gYhY/kmaUybKqgEXKegdjyLlwAD90C3rMLgn1y1ghpiefNQ33KDsDXj11W9LqJWJvhrKjjQuuL3aFRD6ZVnj8l6BtR/BW9RsVyd1LnMJC5PfzPl8NyvL3K0mQShbzmbPkyt45rSz793sbdPxWLSpiQHyjE98suIvfehd3ucOPdYwxUoFaCpgksuvM6visv1VL7aaucUa/MRPOVrPtAYT1JUprQQGl8RL8q0mE0vMM50RKHckZbCYq9+fVoED4KVLR9Qh/xDTRrfi+CMFVurEZBVNmyhwf8hemNE7E+f71UTleqrY7fAdvP5CZ3elXOXjw== [email protected]
Finally lets see if your profile data is filled and correct.
Go to Settings - Profile
and check the fields Name
and Public email
.
Then go to Settings - Emails
and verify that the Primary email address
is set and it's correct.
Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android.
- Import Android Studio Setting - Do not import settings.
- Data Sharing - Don't send.
- Android Studio Setup Wizard
- Welcome: Next.
- Install Type: Custom
- Select default JDK Location: JAVA_HOME: /etc/alternatives/java_sdk_1.8.0
- Select UI Theme: Darcula/Light.
- SDK Components Setup: Disable Android Virtual Device and Next.
- Verify Settings: Next.
- Emulator Settings: Finish.
To install these:
- Start Android Studio.
- Configure > Plugins.
- Select the Flutter plugin and click "Install".
- Click "Install" when prompted to install the Dart plugin.
- Click "Restart IDE" when prompted.
- Start Android Studio.
- Create New Flutter Project > Flutter Application.
- On Flutter SDK path select "Install SDK..." and the path
/home/vagrant/Android/flutter
- Wait while Flutter repository is downloaded.
- Click "Restart IDE" when prompted.
-
Start Visual Studio Code.
-
Go to Extensions in the left menu.
-
Type "flutter" in the extensions search field, select Flutter in the list, and click Install. This also installs the required Dart plugin.
-
Invoke View > Command Palette...
-
Type "doctor", and select "Flutter: Run Flutter Doctor".
-
Review the output in the OUTPUT pane for any issues. Make sure to select Flutter from the dropdown in the different Output Options.
To review licenses and accept them, run the following command:
flutter doctor --android-licenses
The reply "y" (yes) to accept the licenses that have not been accepted.