All language subtitles for 10. Flutter Windows Setup

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

1 1

So, now, we saw the installation steps 2

2

for Mac OS. 3

3

Let's now see how we can set up Flutter on Windows. 4

4

Therefore, if you are not using Windows you can, 5

5

of course, skip this video. 6

6

Now, for Windows I'm again on flutter.dev, 7

7

and their under the docs under Get started. 8

8

We can choose Windows 9

9

and there we find the detailed setup instructions. 10

10

Now, I strongly recommend 11

11

that you all to go through these written instructions here. 12

12

I will go through the entire installation with you 13

13

in this video, but since of course the setup process 14

14

could change in one or two details over time, 15

15

and also so that you have a well written guide 16

16

those official instructions are a great place to go, 17

17

especially if you're facing problems 18

18

or if you're getting stuck. 19

19

So, here we see the different Windows installation guides, 20

20

and we start with the system requirements 21

21

that you should fulfill here. 22

22

Now, let's start with the tools that you need. 23

23

Flutter, as you see, depends on two core tools 24

24

that you should have installed 25

25

in your Windows environment. 26

26

For one, that's the Windows PowerShell, 27

27

basically, a command prompt, a terminal, which allows you 28

28

to run some commands on Windows, 29

29

and it's already pre installed on Windows 10 30

30

on older versions of Windows seven, and eight. 31

31

You can install it, just as explained 32

32

on this page, this link leads to. 33

33

Now, once you've got the Windows PowerShell set up, 34

34

I already do have it set up because I'm on Windows 10, 35

35

we have to install Git. 36

36

Now, Git four Windows is a version control tool, 37

37

which means it allows you 38

38

to manage source code, creates different snapshots 39

39

of your source code and if you mess something up, 40

40

you can go back to an older version of your code. 41

41

Now, this is in general useful for a developer, 42

42

but it's actually not a tool we're going to use 43

43

throughout this course, 44

44

because using it is totally optional, 45

45

and there are dedicated Git resources 46

46

if you wanna learn more about it, 47

47

you can use it with Flutter. 48

48

Nonetheless, though, even 49

49

though we're not going to use it here, 50

50

we need to install it because Flutter 51

51

and the Flutter setup also needs it under the hood. 52

52

So, here on this link, Git for Windows, 53

53

you're taken to the page where you can download it 54

54

and here, we wanna download Git for Windows 55

55

which is a tool we can install, 56

56

simply to the Downloads folder 57

57

and now wait for this download to finish. 58

58

Once the download finishes, 59

59

we can just start this executable, start this installer, 60

60

and this will open up this installer here 61

61

and there we can simply walk through it. 62

62

Now, here, first of all, the default options should be fine. 63

63

So, you can just go with those as you see here. 64

64

You can also stick to that default editor for Git 65

65

whatever is chosen as a default for you her,. 66

66

This is not too important right now. 67

67

And now here, that's important. 68

68

Here on this step we see in the Flutter documentation 69

69

that we should choose the Use Git 70

70

from the Windows command prompt option 71

71

during the installation. 72

72

Now, here in the installer, 73

73

we see the Use Git from Git Bash only option 74

74

which is not the one 75

75

and we see the Git from the command line 76

76

and also from 3rd-party software option, 77

77

which is actually the option we want here 78

78

and it's also the recommended option here, 79

79

so it's the option with which we should go here. 80

80

Let's click Next thereafter. 81

81

We can keep the defaults here as well 82

82

and click Next again. 83

83

Again, keep the default here as well and, again, click Next. 84

84

Click Next. 85

85

Keep all the defaults basically, as you can tell. 86

86

Also on this page, on this page, 87

87

and finally we can click Install. 88

88

So, the only important thing really was 89

89

that Git from Windows command prompt 90

90

which you should choose correctly, but there as you saw, 91

91

we also went with the default 92

92

and this will now install Git this tool 93

93

which Flutter will use behind the scenes 94

94

during installation on our system. 95

95

So, let's wait for this installation to finish. 96

96

And now, that this is finished, 97

97

we don't have to view the release notes, 98

98

we can click Next. 99

99

Now, one thing you can do right away, 100

100

is you can open up the Windows PowerShell 101

101

and in there simply type git and if you type this you 102

102

should see something like this, you should not see an error, 103

103

that's the important thing and this means 104

104

that Git was installed successfully. 105

105

If it wasn't installed successfully try installing it again, 106

106

and make sure you pick all the right settings. 107

107

Also try restarting your system 108

108

after you installed Git, this might also fix a few errors, 109

109

where PowerShell doesn't recognize it, 110

110

even though it's available already. 111

111

Now, once that's done, 112

112

we can finally get started with Flutter. 113

113

So, now we can get the Flutter SDK 114

114

and here we got a download link, which we again, 115

115

simply click to download the Flutter SDK 116

116

so the Flutter tool, basically. 117

117

This will then be the tool which allows us 118

118

to create Flutter projects, 119

119

but also to build those projects 120

120

and to turn our source code into native mobile apps. 121

121

So, this is the core tool of this entire course in the end, 122

122

after all, it is a Flutter course. 123

123

So, let's wait for this download to finish. 124

124

And once it's finished you can extract this zip file 125

125

and now here's where you should pay close attention 126

126

this zip file contains a flutter folder. 127

127

Now, anywhere on your system in any path of your choice, 128

128

for example, here in my case on D, 129

129

and then a folder which I created which I named development, 130

130

you should drag this Flutter folder into that path. 131

131

So, any path on the system 132

132

where you have read and write access to, 133

133

so not a system exclusive part, 134

134

not a path where Windows itself is installed, 135

135

but somewhere on the desktop or, like in my case, 136

136

on the D partition, and then, 137

137

in a brand new development folder, which I have in there. 138

138

You should drag that Zipped flutter folder 139

139

into that new folder, and basically extract 140

140

that file which that you just downloaded into that folder. 141

141

Now, this can take a while to finish, and as a side note, 142

142

the Barchart folder which you see here, 143

143

you can totally ignore that. 144

144

It has nothing to do with Flutter. 145

145

That's just my development folder 146

146

where I have various development tools and projects, 147

147

and that's just another project 148

148

totally unrelated to Flutter. 149

149

So, let's wait for this extraction to finish. 150

150

So, now the extraction finished, 151

151

I'm going to get rid of that Barchart folder 152

152

to make sure it's not confusing you, 153

153

and with that we downloaded and stored the Flutter tool 154

154

and now, in the flutter folder we 155

155

also find a flutter_console.bat file 156

156

and if we execute this, 157

157

we actually open up a terminal here on Windows, 158

158

where we can run Flutter commands. 159

159

For example, you can type just Flutter in here, 160

160

and you will get a list of all the commands you 161

161

can run with the Flutter tool. 162

162

The Flutter tool is now available here in that console, 163

163

and we can, for example, 164

164

use it to create new Flutter projects 165

165

or also to run projects that we created, for example, 166

166

to run them on a connected device and to test our app. 167

167

We're not there yet though. 168

168

Whilst it's nice that we have this executable 169

169

that opens this terminal. 170

170

It means that we can basically 171

171

only run Flutter commands here, 172

172

inside of that Flutter folder, 173

173

after double clicking the file. 174

174

In reality, we want to create Flutter projects, 175

175

somewhere else on our system though. 176

176

This here is just a tool, Flutter, 177

177

our projects that use the tool should live somewhere else, 178

178

just as you don't store all your Microsoft Word documents 179

179

in the installation folder of Microsoft Word, 180

180

but maybe in a Documents folder 181

181

somewhere else on your system. 182

182

It's the same with development and Flutter, 183

183

we might have our tool here, our projects 184

184

are probably stored somewhere else. 185

185

And for that we can go back to the web page. 186

186

We now completed the download and extraction step here 187

187

and now we can move on to the Update your path step. 188

188

Because right now we're only able 189

189

to run the Flutter command after we double clicked 190

190

on that flutter_console.bat file, 191

191

and that's not what we want 192

192

because this restricts our flexibility regarding 193

193

where we can use that tool. 194

194

So, therefore, let's now 195

195

edit the environment variables on Windows. 196

196

For that you can open up your start menu, search for env 197

197

and you should get this Edit environment variables 198

198

for your account setting here. 199

199

Environment variables are basically global variables 200

200

on your system, which configure various aspects of Windows. 201

201

And, for example here, we can also configure which commands 202

202

are available in the default command prompt or PowerShell. 203

203

So, those interactive input environments 204

204

which we have on Windows. 205

205

And now, we wanna add our Flutter tool to such a variable 206

206

to unlock it in the entire PowerShell 207

207

and command prompt everywhere on the system, 208

208

and not just after we launched 209

209

this flutter_console.bat file. 210

210

For that, here in the Environment Variables settings window, 211

211

we should check under user variables here 212

212

whether we have a Path variable. 213

213

If you don't have it, as you see here in documentation, 214

214

you should simply create a new variable named Path 215

215

with the full path to the flutter\bin folder as a value. 216

216

If you do have it already, as I do, you can double click 217

217

on it and simply add a new entry here. 218

218

Now, the entry we add here is the same 219

219

as if we would create a new Path variable. 220

220

We go back to the Flutter folder which we extracted before, 221

221

and there into the bin folder, and now click 222

222

into the path up there, into this path bar, 223

223

so that you get a path written like this 224

224

and copy this full path. 225

225

Now, we'll go back to the environment variables 226

226

and enter this path here into your new 227

227

or existing Path variable and click OK thereafter 228

228

and with that we can click OK again 229

229

and now we set this variable. 230

230

Now, make sure you close all existing PowerShell 231

231

or Command Prompt Windows you might have open. 232

232

I have none here. 233

233

And there after we can, again, open PowerShell, 234

234

or simply the default command prompt terminal here 235

235

and in there, we should now be able to run Flutter 236

236

and see a list of available commands 237

237

which simply proves that everything worked 238

238

and that we are ready to run the Flutter tool 239

239

and now that's the default command prompt, 240

240

we can run it anywhere on our system. 241

241

We can now use that to create and run Flutter projects. 242

242

Now, the first step we wanna do there after 243

243

is we wanna run flutter doctor, 244

244

which analyzes our entire system setup 245

245

and tells us if something is missing. 246

246

So, if I run flutter doctor here, 247

247

it will now do that analysis, 248

248

and it sees that Flutter was installed, 249

249

but it sees that Android tools 250

250

are missing that Android Studio is missing, 251

251

and that we got no connected device 252

252

on which we could test our Flutter app. 253

253

Now, we'll need to install Android, 254

254

to make sure that we can build Android apps with Flutter 255

255

and will then also be able 256

256

to spin up a virtual Android device 257

257

which allows us to test Flutter apps 258

258

and that of course will be another important step. 259

259

So, let's continue with that. 260

260

Unsurprisingly, it's also the next step here 261

261

in the official documentation, the Android setup. 262

262

And here the step is, the first step, 263

263

is to download and install Android Studio. 264

264

So, let's click that link so then we're taken 265

265

to the Android Studio page 266

266

and on that page download Android Studio. 267

267

A gree to the license agreements here 268

268

and download it for Windows. 269

269

This will download an installer which we can execute 270

270

to install the Android Studio tool on our system. 271

271

The Android Studio tool is a tool 272

272

that allows us to write Android code. 273

273

That's not so important for us 274

274

because we're going to write Flutter code, 275

275

not Android, Flutter then, behind the scenes, 276

276

can be transformed to Android code basically, automatically, 277

277

but we'll write Flutter code. 278

278

So, writing Android code is not our number one reason 279

279

for downloading this. 280

280

Instead, we download Android Studio 281

281

because besides this editor to write code, 282

282

it gives us all the tools you could say, 283

283

which Flutter uses behind the scenes to generate 284

284

and build Android apps to prepare them 285

285

for publishing them to the Google Play Store, for example, 286

286

all those essential Android built tools 287

287

are part of Android Studio, 288

288

which is why we need to download and install it. 289

289

So, let's now wait for this download to finish 290

290

before we can then continue with the installation 291

291

and with setting up Android. 292

292

So, now the download finished for me, 293

293

I'm going to click on the downloaded file 294

294

to open up that installer, 295

295

which will now install Android Studio, 296

296

and which will also allow us 297

297

to install additional Android components, 298

298

which we'll need to build Android apps with Flutter. 299

299

So, let's walk through that installer. 300

300

We wanna install Android Studio, 301

301

and the Android virtual device here. 302

302

This is a tool which will allow us 303

303

to create virtual Android emulators later 304

304

for testing the app. 305

305

You can of course also test it on their real Android device, 306

306

and I will show how that works 307

307

throughout the course as well. 308

308

But if you don't own such a device, 309

309

and even if you do, you want to test it 310

310

on multiple different devices, 311

311

and with the Android virtual device tool, 312

312

you can create different virtual Android phones 313

313

to test your app on, so definitely install that. 314

314

Click Next thereafter, 315

315

and now choose the installation path. 316

316

You can absolutely go with the default here. 317

317

I will, however, choose a different folder 318

318

and install this, in my example, 319

319

on the D partition under Program Files 320

320

and their under Android. 321

321

Now, this path, of course is up to you. 322

322

That's where I'm going to install it. 323

323

Click Next thereafter and Install 324

324

and this will now install Android Studio, on your system. 325

325

So, let's wait for this to finish 326

326

and with it finished let's click Next here. 327

327

Now, thereafter, we can start Android Studio, 328

328

so we can leave that checked, 329

329

because now we'll continue inside of Android Studio. 330

330

So, let's wait for this to start up 331

331

and the first time you're opening this 332

332

it should start up this configuration wizard here. 333

333

Now, let's go through that. 334

334

Let's click Next here, 335

335

and then choose Custom here under settings 336

336

so that we can configure everything. 337

337

Let's click Next thereafter. 338

338

Keep that default path for the Java Development Kit, 339

339

which Android Studio needs. 340

340

Click Next. 341

341

Now, you can choose an appearance for Android Studio. 342

342

It's totally up to you 343

343

whether you want the light or dark theme. 344

344

We're not going to write code in there anyways 345

345

because I will use a different editor 346

346

throughout the course and I'll show you 347

347

how to set up that different editor later. 348

348

So, you can choose whatever you want here. 349

349

Click Next. 350

350

And now, here, it's important. 351

351

You wanna choose the Android SDK, 352

352

and also the Android SDK Platform here, 353

353

and there simply keep the default 354

354

which it checked for you already. 355

355

In my case that's API 30, 356

356

but it might be a different version for you. 357

357

If available, you also wanna install that HAXM, 358

358

this Intel HAXM thing here, 359

359

in my case it already is installed, 360

360

which is why I can't check it. 361

361

If you can check it, 362

362

and it's not installed yet make sure you add it. 363

363

If you don't have this option, 364

364

don't worry, you can continue nonetheless. 365

365

Also make sure you check 366

366

this Android virtual device box here, 367

367

so that you installed that as well. 368

368

And then, choose a location for the Android SDK, 369

369

and here I'm going to choose a different location, 370

370

I'm going to add this in my development folder, 371

371

next to the flutter folder 372

372

and in there I'm going to create a new folder, 373

373

which I'll name Android-sdk, 374

374

make sure you pick a name without any white space 375

375

in it here because that could cause problems 376

376

and then, simply click Next. 377

377

You can also keep the default here 378

378

which would be on the C drive, though. 379

379

With all those options let's click Next here. 380

380

We can stick to these defaults here, 381

381

you might not see this screen 382

382

if you don't have this HAXM tool available. 383

383

No problem in that case, no worries. 384

384

Let's click Next and Finish and this will now download 385

385

and install all those extra Android tools we need 386

386

for building and testing Android apps 387

387

and whilst we're not going to write Android code 388

388

on our own, Flutter will use these tools, under the hood, 389

389

to basically convert our Flutter code to Android code, 390

390

you could say, to build that Android app based on our code. 391

391

That's why we need to install all of that, 392

392

and we need the Android virtual device tool 393

393

which is also being installed to make sure 394

394

that we can also test our app on virtual devices. 395

395

Now, let's wait for all those downloads 396

396

and this installation to finish now. 397

397

As a side note, this installation process 398

398

can really take a while, depending on your internet speed, 399

399

the general hardware you're running on and in general, 400

400

this really can take a couple of minutes, 401

401

so don't worry if it seems like 402

402

it gets stuck during installation, it isn't. 403

403

Bnow, once this entire installation process finished, 404

404

we can click Finish here and now we're ready 405

405

to create a Flutter project. 406

406

We actually could do that before as well 407

407

but now we'll also be able to build this 408

408

as an Android project then, 409

409

and run it on a real or virtual Android device. 410

410

Now, let's get started with that and for that, 411

411

let's create a new Flutter project first of all. 412

412

So, let's run flutter doctor again 413

413

to verify whether everything is prepared now. 414

414

And, at least, if you installed the Android SDK 415

415

in a non-default directory, as I did it, 416

416

you will see that Flutter 417

417

is not able to locate the Android SDK. 418

418

If you did go with the default path, 419

419

you will not get this error, of course. 420

420

The fix is simple, we'll need 421

421

to add another environment variable 422

422

which has this name ANDROID_SDK_ROOT. 423

423

So, let's add it to the system environment variables again 424

424

and then there environment variables and, now here, 425

425

under your user environment variables click New. 426

426

And choose ANDROID_SDK_ROOT as a name 427

427

and now as a value the path to the Android SDK. 428

428

So, for me, that's under D, development, 429

429

and then here Android SDK. 430

430

I'm going to grab this full path and insert it here 431

431

as a value for the ANDROID_SDK_ROOT variable. 432

432

Click OK and OK and restart the command prompt thereafter 433

433

and in there, again, let's type flutter doctor 434

434

and see whether this now works. 435

435

And if we do so, you see that now at least 436

436

it's one step further, 437

437

it's checking the Android licenses but it might detect 438

438

that not all licenses have been accepted yet. 439

439

To resolve this, 440

440

simply run flutter doctor --Android-licenses, 441

441

just as it's saying here in this information output. 442

442

Hit Enter, and now this will ask you 443

443

whether you wanna review the licenses. 444

444

I'll type y for yes here and thereafter you'll be prompted 445

445

to accept the license multiple times, 446

446

so I'll just type y and Enter for all those prompts 447

447

until there are no more prompts left and once that is done, 448

448

we can run flutter doctor one more time 449

449

and now, you see, now this works, now the Android tool chain 450

450

is configured correctly. 451

451

Now, I'm still getting a warning here 452

452

regarding the Android Studio setup, 453

453

but we can ignore that 454

454

because we're not going to use Android Studio 455

455

to write Flutter code anyways 456

456

and this warning is only related to us writing code 457

457

in Android Studio. 458

458

We'll use a different IDE for that and I'll show you 459

459

how to set that up in the next lecture. 460

460

So, we can ignore this output here 461

461

and now regarding the connected devices, 462

462

we indeed have no connected devices yet, 463

463

we have no device to test our application. 464

464

So, that will be the next step. 465

465

Before that, back into the official docs, 466

466

we see that we basically have two options. 467

467

We can use a real device, or an emulator. 468

468

I'll show you the emulator setup in just a second. 469

469

We'll also work with a real device throughout the course, 470

470

but I'll come back to that later. 471

471

For the moment, 472

472

you can already install the Google USB Driver here though, 473

473

you can follow the link you find in the official docs 474

474

and download and install this tool 475

475

just as instructed on this page. 476

476

This is all installed through the Android Studio tool, 477

477

you'll need that to later connect the real device. 478

478

So, you'll find all the instructions here, 479

479

you'll need that later once we do run on a real device. 480

480

For us here, we'll continue with the Android emulator 481

481

and for that, we'll need Android Studio, 482

482

so you can just start it, 483

483

so that you see this starting screen. 484

484

And, for one, you can go to the SDK Manager here, 485

485

and verify that you have an SDK installed 486

486

and I actually don't just want to use the latest one, 487

487

but also the latest stable one, which is the latest one 488

488

with a non single character name 489

489

so in my case Pie, Android 9. 490

490

So, I will check this and also installed this SDK, because, 491

491

unlike the latest one, this is more stable, 492

492

and I wanna work with that 493

493

I want to have that installed as well. 494

494

So, let's make sure you check this. 495

495

You might even wanna uncheck the other one to ensure 496

496

that all your Flutter code is turned into Android app 497

497

with that latest stable SDK. 498

498

In addition, under SDK tools here, 499

499

you find the Google USB driver which you need 500

500

to later connect a real device. 501

501

With that, let's click apply 502

502

and this will now install these extra tools 503

503

and uninstall the SDK which we no longer need 504

504

and we can wait for this process to finish 505

505

so that we have the finished setup we need, 506

506

to build Android apps with Flutter. 507

507

So, let's wait for that. 508

508

Now, once that's finished, can click OK here 509

509

and now we're going to work on the virtual device, 510

510

which allows us to test a Flutter app. 511

511

For that, of course, we need a Flutter app. 512

512

So, I'm back in my development folder 513

513

where we installed the Flutter tool 514

514

and the Android SDK. 515

515

And I'm going to create a new folder here 516

516

which I'm going to name projects, 517

517

but you can create that folder anywhere on your system, 518

518

for example on the desktop, 519

519

wherever you wanna manage your Flutter projects 520

520

and when I say project, I basically mean an app, 521

521

and we're going to build multiple apps 522

522

throughout this course, 523

523

so you are going to set up multiple projects 524

524

throughout this course. 525

525

Now, here, we're gonna start with our very first project, 526

526

our very first application and we're going to create 527

527

that app with the Flutter tool 528

528

which we installed earlier. 529

529

For that, we're gonna use the command prompt 530

530

and there the flutter command, 531

531

but we need to run this command from inside the folder 532

532

where we wanna create the project, 533

533

and currently here in the command prompt, 534

534

I'm navigated into C:\Users, my username, 535

535

that's not where I wanna create that app. 536

536

Instead, I wanna create it on D, development, projects. 537

537

So, to switch there, I'll first of all type D: 538

538

to switch to the D partition 539

539

and then there's the cd command, 540

540

which stands for change directory, 541

541

to switch into the development folder 542

542

and then, after hitting Enter, 543

543

I'll cd into the projects folder there 544

544

and now we're in the development projects folder 545

545

inside of this command prompt. 546

546

So, now, any commands we're going to run will run 547

547

inside of that folder, and that's important 548

548

because we're going to run the flutter create command 549

549

to create a new app, a new project in that place 550

550

and I'm going to name it first_app. 551

551

Now, this name is up to you. 552

552

This is the name of your first project, 553

553

the only important thing is that it should be one word, 554

554

and if it consists of multiple words, like here, first_app, 555

555

those words should be connected with an underscore. 556

556

Once you have that you can hit Enter, 557

557

and this will now create this project folder 558

558

this application folder. 559

559

You see it here under projects, 560

560

there is this first_app folder now 561

561

and that holds the source code 562

562

in which we're going to work here in the lib folder, 563

563

the start file, and a couple of config folders. 564

564

Now, I'll explain everything about the code 565

565

and about this configuration throughout this course. 566

566

We're going to write code in there as well, 567

567

and I show you how to write code 568

568

and how to set up everything in the next lecture. 569

569

For now, let's just run this app, 570

570

because it turns out that the default app created 571

571

by Flutter is actually something we can preview on a device, 572

572

so it gives us a little dummy app out of the box. 573

573

And to run this, we need that virtual device. 574

574

So, back here in the Android Studio launch screen, 575

575

under configure, we now need the AVD manager, 576

576

which stands for Android Virtual Device Manager. 577

577

Here we can create and manage our virtual devices. 578

578

You might already have one, 579

579

but you can also create a new virtual device 580

580

by clicking on this Create Virtual Device button. 581

581

Now, here you can choose any template. 582

582

I'm going to go with the Pixel 2 phone, and click next here. 583

583

Now here, you need a system image, 584

584

which is basically the Android operating system 585

585

which will be installed on that virtual device, 586

586

and you wanna go with the latest stable one here, 587

587

which is the latest one that has a real name, 588

588

and not just a character identifier. 589

589

So, in my case it's Pie API level 28. 590

590

I don't have it yet so I need to download it. 591

591

So, click on Download here, 592

592

and this will now install this operating system image, 593

593

which will be used to set up that virtual device later. 594

594

So, again, another download 595

595

for which we have to wait to finish 596

596

and with that completed, let's click Finish. 597

597

Select this downloaded image now and click Next. 598

598

You can leave all the other default settings here 599

599

as they are and click Finish again 600

600

and this will now create a new emulator. 601

601

We can now launch this emulator 602

602

by clicking this play icon here, 603

603

and this will spin up this virtual device 604

604

and launch it so that we can run Android apps on it 605

605

and this takes us back to the application we created, 606

606

this first app we built. 607

607

Because, now, once we started this emulator, 608

608

we can open an existing Android Studio project here 609

609

from that starting window of Android Studio 610

610

and there, under development projects, 611

611

select your first_app project like this. 612

612

Now, again, we're not gonna use Android Studio 613

613

throughout this course, we're not going to write code here 614

614

throughout this course, 615

615

but we can get started with this here. 616

616

Now, when I opened this the first time, I'm prompted here 617

617

whether I wanna install extra plugins, 618

618

and I'll click on configure plugins here 619

619

and choose the Flutter plugin which will help us 620

620

with Flutter development. 621

621

Though we could also ignore this here because, again, 622

622

we're not gonna write Flutter code 623

623

with Android Studio throughout this course, 624

624

but it also won't hurt if we add it here. 625

625

So, after adding this I'll restart Android Studio. 626

626

This will reopen this project thereafter 627

627

and now with that opened, 628

628

make sure that you do have an emulator up and running 629

629

so that you did start an emulator as shown before. 630

630

If you didn't do it yet under tools you can get back 631

631

to the AVD manager and launch our virtual device again. 632

632

And now, you should see it here in the drop down selected. 633

633

And now you can press that run button 634

634

to run your Flutter app on that virtual device. 635

635

Now, this build process which was started on the device 636

636

can take a couple of minutes when you run it the first time, 637

637

don't worry about that. 638

638

And once it's done you should see your Flutter app running 639

639

on that emulator and you can hit the plus button here 640

640

to increment the counter. 641

641

Pretty awesome. 642

642

Our Flutter app finally running on an emulator, 643

643

and of course we'll change this app soon. 644

644

Now, as I mentioned, I won't use Android Studio, 645

645

as an editor here and therefore, 646

646

I also want to show you a way 647

647

of running this without Android Studio. 648

648

You can do that by going to the command prompt, 649

649

navigating into the folder where you have your first_app 650

650

or into this project folder you created, and in there, 651

651

you can run flutter run. 652

652

And this will now do the exact same 653

653

as you did with the command inside, or with the click 654

654

of the button inside Android Studio, 655

655

but without you doing it through Android Studio, 656

656

it will build the app, and ship it to your emulator 657

657

and run it there. 658

658

And this is actually how I will run my apps 659

659

for the rest of this course, 660

660

since I won't use Android Studio. 661

661

You can use either approach, however, 662

662

using flutter run will have advantages 663

663

like the hot reloading I'll introduce in a second.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.