Skip to content

Flutter

2024 07 27 Flutter

Getting started page flutter.dev.

Create new project

flutter create myapp

Flutter choose device VS Code

To run the app

flutter run

or just hit f5

To perform hot reload simply type

r

into the terminal.

To create a new Statless Widget, simply type stl into the editor.

Fonts

Add font files to /fonts then edit the pubspec.yaml file. Refresh the pubspec by entering the following into the cmd

flutter pub get

Flutter packages

https://pub.dev/

Hit the copy buttuon next to a package (i.e. flutter_svg).

Paste it in the dependencies section within pubspec.yaml. Then run

flutter pub get

SVG Icons

Create a folder /assets, and within that /assets/icons.

Then within pubspec.yaml, uncomment the assets block and add - assets/icons/

Refactoring Widgets

Click on a widget, i.e. Container, and hit ctr .. Then you can wrap in widget, then type the widget (i.e. GestureDetector).