Skip to content

This is a template for building Flutter applications for Android, which includes basic dynamic themes, theme settings, language settings and GitHub Actions scripts.

License

Notifications You must be signed in to change notification settings

BHznJNs/flutter_android_template

Repository files navigation


NFC PLinkD Logo

Flutter Android Template

中文 | 日本語 | Français

This is a template for building Flutter applications for Android, which includes basic dynamic themes, theme settings, language settings and GitHub Actions scripts.

How to Use

Initiation

Use this template repo, change the name and clone it.

Changing the Project Name and Package Name

Changing the project name in Flutter involves manually modifying several files. Follow these steps to change the project name:

  1. Update pubspec.yaml: Change the name property to your new project name.
name: your_new_project_name
  1. Update android/app/src/main/res/values/strings.xml:

Change the app_name string to your new project name.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Your New App Name</string>
</resources>
  1. Update package names

Change the package name used in android/app/src/main/kotlin/com/example/template/MainActivity.kt, as well as the path of it. Change the namespace and applicationId used in the android\app\build.gradle.kts file.

  1. Update the imports in .dart

Change the imports from:

import 'package:flutter_android_template/**.dart';

to:

import 'package:your_new_project_name/**.dart';

App signing for GitHub Actions

Get your .jks file, create the base64 string of it:

# Unix
base64 -w 0 <Your-Key-Store-Name>.jks
# Windows
[System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes("<Your-Key-Store-Name>.jks"))

In the Secrets and Variables -- Actions of your GitHub repo, add secrets:

  • SIGNING_KEYSTORE: The base64 code created above
  • SIGNING_KEYSTORE_PASSWORD: The key store password
  • SIGNING_KEY_ALIAS: The alias for the .jks file
  • SIGNING_KEY_PASSWORD: The password for the alias

Use case

  • MotionEaseTune, A simple application that can prevent you from motion sickness via 100Hz sound.

About

This is a template for building Flutter applications for Android, which includes basic dynamic themes, theme settings, language settings and GitHub Actions scripts.

Topics

Resources

License

Stars

Watchers

Forks