Create a NEW project
- Go to where you want the project folder to be
- Do NOT create a folder with that name
- Open folder in vscode
- F1 "> Flutter: New Project" and name it
- Youre done!
Packages
Install a Package
- Go to package site: https://pub.dev/packages/http
- Copy the name WITH version (http 1.3.0)
- Open pubspec.yaml in your project
- Under dependencies, add "package_name: ^minimum.package.version" (http: ^1.3.0)
- Save file
- Run "flutter pub get" (VSCode might autorun this, check the notification to see if that happened, if unsure run this anyways)
Building
Windows
- Open a terminal
- Run $ flutter build windows --release
- Output is in: "build\windows\x64\runner\Release\appname.exe"
Android
- Open a terminal
- Run $ flutter build apk --release
- Output is in: "build\app\outputs\flutter-apk\app-release.apk"
Deploying
Windows
Android
- Run deploy-release-android.bat
Elements
Buttons
ElevatedButton looks the best
- ElevatedButton
- TextButton
- OutlinedButton
Layouts
Row
Horizontal
Column
Vertical
Routing/Navigation
Screens
A Screen is a "View" which holds "Pages"
Pages
A Page holds content and lives inside of a "Screen"
Example: a NavigationBar's items are Pages.
Navigator class
- Navigator.push(context, MaterialPageRoute(builder: (context) => const YourScreen())); // This adds a Screen to the Navigator AND will display it.
- Navigator.pop(context); // This removes the current Route from the Navgation.