Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating template to 2022 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
.buildlog/
.history
.svn/
*.info
*.info.backup
index.html
*.lock
google-services*.json
key.properties

# IntelliJ related
*.iml
Expand Down
Binary file added .gradle/6.9.3/fileChanges/last-build.bin
Binary file not shown.
Empty file added .gradle/6.9.3/gc.properties
Empty file.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Wed Oct 26 18:08:25 CEST 2022
gradle.version=6.9.3
Empty file added .gradle/vcs-1/gc.properties
Empty file.
7 changes: 7 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\D:\\Prog\\StudioProjects\\create_flutter_provider2022",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/create_flutter_provider2022/v17/.suo
Binary file not shown.
63 changes: 63 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [


{
"name": "create_flutter_provider (android debug dev)",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"program": "lib/main.dart",
"args": [
"--flavor",
"dev"
]
},
{
"name": "create_flutter_provider (android release prod)",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"program": "lib/main_prod.dart",

"args": [
"--flavor",
"prod"
]
},
{
"name": "create_flutter_provider (web debug dev)",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"preLaunchTask": "copywebdev",
"program": "lib/main.dart",
"args": [
"--flavor",
"dev",
"localhost",
"--web-port",
"5000"
]
},
{
"name": "create_flutter_provider (web debug prod)",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"preLaunchTask": "copywebprod",
"program": "lib/main_prod.dart",
"args": [
"--flavor",
"prod",
"localhost",
"--web-port",
"5000"
]
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
26 changes: 26 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "copywebdev",
"type": "shell",
"windows": {
"command": "${workspaceFolder}${pathSeparator}copy_webenv.cmd"
},
"args": [
"dev"
],
"problemMatcher": []
},
{
"label": "copywebprod",
"type": "shell",
"command": "${workspaceFolder}${pathSeparator}copy_webenv.cmd",
"args": [
"prod"
]
}
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ For the sub folder called ‘res’, ignore it for now. We will go through that

4. Having different app name and app icon for Dev and Prod
We want to have a different app name for our project. This is helpful as with Flavor setup, we can install both app in the same devices for testing.
Having app name such as NoteApp-Dev or Note-Dev or Note-Prod helps us to identify which app is for which environment – development or production.
Having app name such as NoteApp-Dev or create_flutter_provider_app or Note-Prod helps us to identify which app is for which environment – development or production.
The same concept and benefits if we have different app icon for each apps that are connecting to different environment.
For app name, create file called strings.xml and with the following content:
```
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Note-Dev</string>
<string name="app_name">create_flutter_provider_app</string>
</resources>

```
Expand Down
29 changes: 29 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# 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

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
37 changes: 32 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand All @@ -25,22 +25,29 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystorePropertiesFile = rootProject.file("key.properties")

def keystoreProperties = new Properties()

keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 28
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.create_flutter_provider_app"//com.example.create_flutter_provider_app
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 19
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -60,7 +67,7 @@ android {
productFlavors {
dev {
dimension "flavor-type"
applicationId "com.example.create_flutter_provider_app.dev"
applicationId "com.example.create_flutter_provider_app"
versionCode 1
versionName "1.0"
}
Expand All @@ -71,6 +78,22 @@ android {
versionName "1.0"
}
}
signingConfigs{

release{

keyAlias keystoreProperties['keyAlias']

keyPassword keystoreProperties['keyPassword']

storeFile file(keystoreProperties['storeFile'])

storePassword keystoreProperties['storePassword']

}

}

}

flutter {
Expand All @@ -83,6 +106,10 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation platform('com.google.firebase:firebase-bom:31.1.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.android.gms:play-services-auth:20.3.0'
}


Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.venturearkstudio.noteapp">
package="com.example.create_flutter_provider_app">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
40 changes: 0 additions & 40 deletions android/app/src/dev/google-services.json

This file was deleted.

2 changes: 1 addition & 1 deletion android/app/src/dev/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Note-Dev</string>
<string name="app_name">create_flutter_provider_app</string>
</resources>
5 changes: 3 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.venturearkstudio.noteapp">
package="com.example.create_flutter_provider_app">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<meta-data android:name="flutterEmbedding" android:value="2" />
<application
android:name="io.flutter.app.FlutterApplication"
android:name="${applicationName}"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.create_flutter_provider2022

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.venturearkstudio.noteapp
package com.example.create_flutter_provider_app

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
Expand Down
12 changes: 12 additions & 0 deletions android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
18 changes: 18 additions & 0 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.venturearkstudio.noteapp">
package="com.example.create_flutter_provider_app">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Loading