Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutter": "3.29.3",
"flutter": "3.32.0",
"flavors": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: "[Flutter - Upload to Firebase App Distribution]"
run: cd android; ./gradlew appDistributionUploadProductionRelease; cd ..

# TODO: Add correct AppId from the Firebase Project
# TODO(HELU): Add correct AppId from the Firebase Project
- name: "[Flutter - Upload Crashlytics Mapping Files]"
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: "[Flutter - Upload to Firebase App Distribution]"
run: cd android; ./gradlew appDistributionUplodaStagingRelease; cd ..

# TODO: Add correct AppId from the Firebase Project
# TODO(HELU): Add correct AppId from the Firebase Project
- name: "[Flutter - Upload Crashlytics Mapping Files]"
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/android_play_store_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: r0adkll/upload-google-play@v1.1.1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_DISTRIBUTION_SERVICE_ACCOUNT_JSON }}
packageName: com.strv.flutter.template
packageName: cz.helu.flutter.template
releaseFiles: build/app/outputs/bundle/productionRelease/app-production-release.aab
mappingFile: build/app/outputs/mapping/productionRelease/mapping.txt
whatsNewDirectory: whatsnew
Expand All @@ -61,7 +61,7 @@ jobs:
#status: draft # Upload it as draft release if you want to manually publish the release from GooglePlay console
#userFraction: 0.1 # Rollout of the release <0;1>

# TODO: Add correct AppId from the Firebase Project
# TODO(HELU): Add correct AppId from the Firebase Project
- name: "[Flutter - Upload Crashlytics Mapping Files]"
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"dart.flutterSdkPath": ".fvm/versions/3.29.3"
"dart.flutterSdkPath": ".fvm/flutter_sdk"
}
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
![Flutter Template Logo](docs/flutter_template.jpg)

<div align="center">

[![Flutter](https://img.shields.io/badge/Flutter-3.32-blue)](https://docs.flutter.dev/release/whats-new#flutter-332)
[![Dart](https://img.shields.io/badge/Dart-3.8.0-blue)](https://dart.dev/guides/whats-new#dart-380)
[![License](https://img.shields.io/github/license/HE-LU/flutter-template)](LICENSE)

</div>

<div align="center">

[![CodeCheck](https://github.com/HE-LU/flutter-template/actions/workflows/flutter_project_codecheck_android.yml/badge.svg)](https://github.com/HE-LU/flutter-template/actions/workflows/flutter_project_codecheck_android.yml)
[![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/HE-LU/flutter-template?utm_source=oss&utm_medium=github&utm_campaign=HE-LU%2Fflutter-template&labelColor=171717&color=FF570A)](#)

</div>


# Flutter Template
- [Project notes](#project-notes)

Expand Down Expand Up @@ -58,7 +76,7 @@
<!-- ################################################## -->
# Project notes

- Notes that could be benefitial to know during the development.
- Notes that could be beneficial to know during the development.
- For example list of test accounts, required credentials, steps required to get testing account, etc.


Expand Down Expand Up @@ -175,7 +193,7 @@ You can read about flavors setup in the following tutorials:
- 🖥️ [Linux](https://docs.flutter.dev/deployment/linux) - Flavors are not supported yet.

In case of using firebase with multiple flavors, you have to:
- for iOS add custom build run script phase and copy appropriate `GoogleService-Info.plist` file. It's already prepared, you just need to uncomment it and add appropriate plists to destinations according to the script.
- For iOS, add the custom Build Run Script phase and copy the appropriate `GoogleService-Info.plist` file. The script is already prepared; simply uncomment it and add the necessary `plist` files to their destinations.

For Google sign in:
- for iOS, you have to copy value from `REVERSED_CLIENT_ID` from `GoogleService-Info.plist` into `GOOGLE_REVERSED_CLIENT_ID` in build settings.
Expand All @@ -189,7 +207,7 @@ For Google sign in:
- As we are using flavors, we have to specify which flavor to build using `--flavor` argument, and also select a correct main file using `-t` argument.
- One of the arguments you should use is `--obfuscate`. This makes reverse engineering harder. This has to be used also with `--split-debug-info` which should make the app smaller, and also specify the directory where the mapping file to read obfuscated stack trace is stored.
- Optional step is to include precompiled Shaders. To do that you have to first [Precompile Shaders](#precompiling-shaders) and add `--bundle-sksl-path` argument.
- In case we would like to build a Debugable version of the app, we have to add `--debug` argument.
- To build a debug version of the app, include the `--debug` flag.

Here is an example of assembling an Android app bundle using all the commands:
```
Expand Down Expand Up @@ -339,7 +357,7 @@ This way we are ensuring that at least the Android version is buildable. We are
## Theming
Theming is done inside `lib/core/themes/app_theme.dart`. Currently, we suggest using Material 3. The main setup is done in file `app_theme.dart`.

The main idea right now is to overwrite the whole `colorScheme` with an "undefined" pinkish color and to not use the default theme colorScheme anywhere in the app. Every widget like AppBar, EleveatedButton, TextField, etc. should have a custom implementation starting with the word `Custom` so it is easily recognizable. This Widget then should wrap the appropriate widget, and should utilize colors from `context.colorScheme`, which has an extension method, as is returning our own implementation of `CustomColorScheme`. All colors should be declared there.
The current approach is to completely override the default `colorScheme` with a custom "undefined" pinkish palette and avoid using the default theme anywhere in the app. Every widget—such as AppBar, ElevatedButton, and TextField—should have a custom implementation prefixed with `Custom` for easy identification. Each `Custom` widget should wrap the corresponding standard widget and use colors from `context.colorScheme` and text styles from `context.textTheme`. These context extensions return our custom implementations: `CustomColorScheme` and `CustomTextTheme`, where all colors and text styles are defined.

The most tricky part of theming is to make sure that the app supports Edge-to-Edge, and that it has correct navigation and StatusBar colors set. To make this possible, we had to implement our own `CustomSystemBarsTheme` class. To use it properly, make sure you are calling `setupSystemBarsTheme` during the App startup. In case of the need of overriding the Brightness for a specific screen, there are two approaches. First, the simple one is to just use `CustomAppBar`, and set brightness to it. Second, wrap the whole Scaffold inside `CustomSystemBarsThemeWidget` and set Brightness to it.
<!-- ################################################## -->
Expand All @@ -357,7 +375,7 @@ To be able to use the firebase provider for Apple login, we need to do some conf
- Create a Service ID - this is the service that would provide sign in with apple. `Developer -> Certificates, Identifiers & Profiles -> Identifiers -> Create new -> Services IDs`
(note: to get into services there is a filter on Identifiers screen on right top where you can switch from identifiers to services.)
- Description will be visible to our users - e.g. Template
- Identifier - can be app/bundle ID `com.strv.flutter.template.develop` or simply `flutter-template-develop`
- Identifier - can be app/bundle ID `cz.helu.flutter.template.develop` or simply `flutter-template-develop`
- Enable Sign in with Apple for the service
- Domains is url of your page e.g. `template.com`
- Return URL is crucial part - this will be taken from Firebase: Authentication -> Sign-in method -> Apple -> callback URL
Expand Down
46 changes: 14 additions & 32 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
include: package:netglade_analysis/lints.yaml

analyzer:
exclude:
exclude:
- 'project_setup/**'
- '**.g.dart'
- '**.gen.dart'
- '**.config.dart'
- '**.graphql.dart'
errors:
todo: info

formatter:
page_width: 140
trailing_commas: preserve

linter:
# The lint rules applied to this project can be customized in the
Expand All @@ -28,36 +36,10 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_redundant_argument_values: true
always_declare_return_types: true
always_use_package_imports: true
avoid_catches_without_on_clauses: true
avoid_catching_errors: true
avoid_empty_else: true
avoid_field_initializers_in_const_classes: true
avoid_final_parameters: true
avoid_multiple_declarations_per_line: true
avoid_types_as_parameter_names: true
avoid_types_on_closure_parameters: true
avoid_unnecessary_containers: true
avoid_void_async: true
await_only_futures: true
camel_case_extensions: true
camel_case_types: true
curly_braces_in_flow_control_structures: true
empty_statements: true
eol_at_end_of_file: true
file_names: true
leading_newlines_in_multiline_strings: true
library_names: true
no_duplicate_case_values: true
no_logic_in_create_state: true
no_self_assignments: true
no_wildcard_variable_uses: true
prefer_single_quotes: true
prefer_void_to_null: true
slash_for_doc_comments: true
unnecessary_brace_in_string_interps: true
sort_pub_dependencies: false
require_trailing_commas: false
avoid_positional_boolean_parameters: false
no_default_cases: false

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
8 changes: 2 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
compileSdkVersion compileAndroidSdkVersion
ndkVersion flutter.ndkVersion
flavorDimensions "env"
namespace "com.strv.flutter.template"
namespace "cz.helu.flutter.template"

compileOptions {
coreLibraryDesugaringEnabled true
Expand Down Expand Up @@ -73,7 +73,6 @@ android {
}

defaultConfig {
applicationId "com.strv.flutter.template"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion minAndroidSdkVersion
Expand Down Expand Up @@ -117,9 +116,6 @@ android {
shrinkResources true

proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

// Comment this when testing dynamic links.
applicationIdSuffix = ".debug"
}
release {
signingConfig signingConfigs.release
Expand All @@ -129,7 +125,7 @@ android {

proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

// TODO: Remove or change to true, once Firebase is set-up correctly
// TODO(HELU): Remove or change to true, once Firebase is set-up correctly
firebaseCrashlytics {
mappingFileUploadEnabled = false
unstrippedNativeLibsDir file("build/app/intermediates/merged_native_libs/productionRelease/out/lib")
Expand Down
40 changes: 20 additions & 20 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"project_info": {
"project_number": "907121519909",
"project_id": "strv-flutter-template",
"storage_bucket": "strv-flutter-template.appspot.com"
"project_id": "helu-flutter-template",
"storage_bucket": "helu-flutter-template.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"android_client_info": {
"package_name": "com.strv.flutter.template"
"package_name": "cz.helu.flutter.template"
}
},
"oauth_client": [
{
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 1,
"android_info": {
"package_name": "com.strv.flutter.template",
"package_name": "cz.helu.flutter.template",
"certificate_hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
},
Expand All @@ -42,7 +42,7 @@
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 2,
"ios_info": {
"bundle_id": "com.strv.flutter.template.staging"
"bundle_id": "cz.helu.flutter.template.staging"
}
}
]
Expand All @@ -53,15 +53,15 @@
"client_info": {
"mobilesdk_app_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"android_client_info": {
"package_name": "com.strv.flutter.template.debug"
"package_name": "cz.helu.flutter.template.debug"
}
},
"oauth_client": [
{
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 1,
"android_info": {
"package_name": "com.strv.flutter.template.debug",
"package_name": "cz.helu.flutter.template.debug",
"certificate_hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
},
Expand All @@ -86,7 +86,7 @@
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 2,
"ios_info": {
"bundle_id": "com.strv.flutter.template.staging"
"bundle_id": "cz.helu.flutter.template.staging"
}
}
]
Expand All @@ -97,15 +97,15 @@
"client_info": {
"mobilesdk_app_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"android_client_info": {
"package_name": "com.strv.flutter.template.develop"
"package_name": "cz.helu.flutter.template.develop"
}
},
"oauth_client": [
{
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 1,
"android_info": {
"package_name": "com.strv.flutter.template.develop",
"package_name": "cz.helu.flutter.template.develop",
"certificate_hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
},
Expand All @@ -130,7 +130,7 @@
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 2,
"ios_info": {
"bundle_id": "com.strv.flutter.template.staging"
"bundle_id": "cz.helu.flutter.template.staging"
}
}
]
Expand All @@ -141,15 +141,15 @@
"client_info": {
"mobilesdk_app_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"android_client_info": {
"package_name": "com.strv.flutter.template.develop.debug"
"package_name": "cz.helu.flutter.template.develop.debug"
}
},
"oauth_client": [
{
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 1,
"android_info": {
"package_name": "com.strv.flutter.template.develop.debug",
"package_name": "cz.helu.flutter.template.develop.debug",
"certificate_hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
},
Expand All @@ -174,7 +174,7 @@
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 2,
"ios_info": {
"bundle_id": "com.strv.flutter.template.staging"
"bundle_id": "cz.helu.flutter.template.staging"
}
}
]
Expand All @@ -185,15 +185,15 @@
"client_info": {
"mobilesdk_app_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"android_client_info": {
"package_name": "com.strv.flutter.template.staging"
"package_name": "cz.helu.flutter.template.staging"
}
},
"oauth_client": [
{
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 1,
"android_info": {
"package_name": "com.strv.flutter.template.staging",
"package_name": "cz.helu.flutter.template.staging",
"certificate_hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
},
Expand All @@ -218,7 +218,7 @@
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 2,
"ios_info": {
"bundle_id": "com.strv.flutter.template.staging"
"bundle_id": "cz.helu.flutter.template.staging"
}
}
]
Expand All @@ -229,15 +229,15 @@
"client_info": {
"mobilesdk_app_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"android_client_info": {
"package_name": "com.strv.flutter.template.staging.debug"
"package_name": "cz.helu.flutter.template.staging.debug"
}
},
"oauth_client": [
{
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 1,
"android_info": {
"package_name": "com.strv.flutter.template.staging.debug",
"package_name": "cz.helu.flutter.template.staging.debug",
"certificate_hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
},
Expand All @@ -262,7 +262,7 @@
"client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"client_type": 2,
"ios_info": {
"bundle_id": "com.strv.flutter.template.staging"
"bundle_id": "cz.helu.flutter.template.staging"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.strv.flutter.template;
package cz.helu.flutter.template;

import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
Expand Down
Binary file modified android/app/src/developDebug/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/developDebug/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/developDebug/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/developDebug/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/developDebug/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/developDebug/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading