To run use the launch configuration in VSCode/Android Studio or use the following commands:
$ flutter run --target lib/main.dart
To build APK use the following commands:
$ flutter build apk --target lib/main.dart
And for builds for release, see the documentation according to the Android and iOS platforms.