···22221. Install Flutter
23232. Run `flutter pub get`
24242525-All you really need is to [install Flutter](https://flutter.dev/docs/get-started/install). Just run `flutter run` to start debugging the app, like you would with any Flutter app.
2525+## Code signing
2626+Create a `android/key.properties` that looks like this:
2727+```
2828+storePassword=example
2929+keyPassword=example
3030+keyAlias=key
3131+storeFile=/path/to/keystore.jks
3232+```
26332727-The app is built using the [scoped_model](https://pub.dev/packages/scoped_model) package, which is worth knowing about. Other than that, it pretty much works like any basic Flutter app, so there's not much else that needs to be said.
3434+Follow Flutter's [Android signing guide](https://docs.flutter.dev/deployment/android#signing-the-app) for more details.
28352936### Generate app icon
3037···34413542Follow [these steps](https://flutter.dev/docs/deployment/android).
36433737-### Releasing a new version
3838-3939-1. Specify a version and build number in `pubspec.yaml`, or use `--build-name` and `--build-number`
4040-2. Generate Android apk: `flutter build apk`
4141-3. Rename the output file to `notifier-x.y.z.apk`
4242-4. Commit with the message `x.y.z` and add a tag/release to it with the output file attached.
4444+### Release new version
4545+1. Update `CHANGELOG.md`
4646+2. Bump the version number in `pubspec.yaml`
4747+3. Run `flutter analyze && flutter test`
4848+4. Run `flutter build apk`
4949+5. Rename the output file to `notifier-x.y.z.apk`
5050+6. Create a git tag in the format `v#.#.#`
5151+7. Create a GitHub release with the release notes and `.apk`
+20-9
android/app/build.gradle
···2525apply plugin: 'kotlin-android'
2626apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27272828+def keystoreProperties = new Properties()
2929+def keystorePropertiesFile = rootProject.file('key.properties')
3030+if (keystorePropertiesFile.exists()) {
3131+ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
3232+}
3333+2834android {
2935 compileSdkVersion flutter.compileSdkVersion
3036 ndkVersion flutter.ndkVersion
···4349 }
44504551 defaultConfig {
4646- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4747- applicationId "com.example.notifier"
5252+ applicationId "space.kasper.notifier"
4853 // You can update the following values to match your application needs.
4954 // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
5055 minSdkVersion 21
···5358 versionName flutterVersionName
5459 }
55605656- buildTypes {
5757- release {
5858- // TODO: Add your own signing config for the release build.
5959- // Signing with the debug keys for now, so `flutter run --release` works.
6060- signingConfig signingConfigs.debug
6161- }
6262- }
6161+ signingConfigs {
6262+ release {
6363+ keyAlias keystoreProperties['keyAlias']
6464+ keyPassword keystoreProperties['keyPassword']
6565+ storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
6666+ storePassword keystoreProperties['storePassword']
6767+ }
6868+ }
6969+ buildTypes {
7070+ release {
7171+ signingConfig signingConfigs.release
7272+ }
7373+ }
6374}
64756576flutter {
···1515# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1616# Read more about iOS versioning at
1717# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1818-version: 1.0.0+1
1818+version: 1.0.0
19192020environment:
2121 sdk: ">=2.17.1 <3.0.0"