Skip to content

Commit

Permalink
configurando a ajustando chamada de variaveis de ambiente
Browse files Browse the repository at this point in the history
  • Loading branch information
itMatos committed Aug 26, 2024
1 parent efd2c9e commit e4b463e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android/app/google-services.json
android/local_maps.properties

#.env file
.env
*.env

#Firebase options file
lib/firebase_options.dart
28 changes: 0 additions & 28 deletions android/.project

This file was deleted.

44 changes: 24 additions & 20 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,44 @@ plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
id "com.google.gms.google-services"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
// Carregar variáveis do arquivo .env
def dotenvPropertiesFile = rootProject.file('.env')
if (dotenvPropertiesFile.exists()) {
dotenvPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
// Obter a chave da API do Maps do local.properties ou .env
def mapsApiKey = localProperties.getProperty('MAPS_API_KEY')
if (mapsApiKey == null) {
throw new GradleException("MAPS_API_KEY not found. Please define it in your .env or local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode', '1')
def flutterVersionName = localProperties.getProperty('flutter.versionName', '1.0')

android {

namespace 'com.zenithaerospace.monitor'

compileSdkVersion 34
compileSdkVersion 34
ndkVersion "25.2.9519653"

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

defaultConfig {
applicationId "com.zenithaerospace.monitor"
Expand All @@ -42,13 +48,11 @@ android {
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// manifestPlaceholders = [MAPS_API_KEY: mapsApiKey]
manifestPlaceholders = [MAPS_API_KEY: mapsApiKey]
}

buildTypes {
release {
// Configuração de assinatura para o build de release
// (Substitua com sua própria configuração de assinatura)
signingConfig signingConfigs.debug
}
}
Expand Down
2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"teste-firebase-zenith","appId":"1:767599767515:android:f96dbb868c7ca38e1e81fe","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"teste-firebase-zenith","configurations":{"android":"1:767599767515:android:f96dbb868c7ca38e1e81fe"}}}}}}
{"flutter":{"platforms":{"android":{"default":{"projectId":"zenith-monitor-dev-a8116","appId":"1:187164656992:android:967f7a157146fd37fb8a05","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"zenith-monitor-dev-a8116","configurations":{"android":"1:187164656992:android:967f7a157146fd37fb8a05"}}}}}}
10 changes: 5 additions & 5 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class DefaultFirebaseOptions {
}

static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyAeOmRf75mRRVoXO1g4cm6wqVUoOuUf97I',
appId: '1:767599767515:android:f96dbb868c7ca38e1e81fe',
messagingSenderId: '767599767515',
projectId: 'teste-firebase-zenith',
storageBucket: 'teste-firebase-zenith.appspot.com',
apiKey: 'AIzaSyCyuxwGpTVrR_rjAxqZoOFc1I-41GtzNaU',
appId: '1:187164656992:android:967f7a157146fd37fb8a05',
messagingSenderId: '187164656992',
projectId: 'zenith-monitor-dev-a8116',
storageBucket: 'zenith-monitor-dev-a8116.appspot.com',
);
}
24 changes: 12 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: _flutterfire_internals
sha256: b46f62516902afb04befa4b30eb6a12ac1f58ca8cb25fb9d632407259555dd3d
sha256: b1595874fbc8f7a50da90f5d8f327bb0bfd6a95dc906c390efe991540c3b54aa
url: "https://pub.dev"
source: hosted
version: "1.3.39"
version: "1.3.40"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -205,34 +205,34 @@ packages:
dependency: "direct main"
description:
name: firebase_auth
sha256: a41b56878fa6aef3ea52962329b47eee333672d4b0ecc406e071b9fc729f242c
sha256: "2457ac6cbc152fa464aad3fb35f98039b0c4ab8e9bedf476672508b291bdbc3a"
url: "https://pub.dev"
source: hosted
version: "5.1.2"
version: "5.1.4"
firebase_auth_platform_interface:
dependency: transitive
description:
name: firebase_auth_platform_interface
sha256: d1c68097588f3b75ef79a22102ff96c311735c254353bccf6824d19f1a7e86b9
sha256: "0408e2ed74b1afa0490a93aa041fe90d7573af7ffc59a641edc6c5b5c1b8d2a4"
url: "https://pub.dev"
source: hosted
version: "7.4.2"
version: "7.4.3"
firebase_auth_web:
dependency: transitive
description:
name: firebase_auth_web
sha256: e66ec0ae5697ee39ccd4865d6887cb0df220dd4ea0b21404910c68ca4c1a731a
sha256: "7e0c6d0fa8c5c1b2ae126a78f2d1a206a77a913f78d20f155487bf746162dccc"
url: "https://pub.dev"
source: hosted
version: "5.12.4"
version: "5.12.5"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
sha256: "5159984ce9b70727473eb388394650677c02c925aaa6c9439905e1f30966a4d5"
sha256: "3187f4f8e49968573fd7403011dca67ba95aae419bc0d8131500fae160d94f92"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "3.3.0"
firebase_core_platform_interface:
dependency: "direct overridden"
description:
Expand All @@ -245,10 +245,10 @@ packages:
dependency: transitive
description:
name: firebase_core_web
sha256: "23509cb3cddfb3c910c143279ac3f07f06d3120f7d835e4a5d4b42558e978712"
sha256: e8d1e22de72cb21cdcfc5eed7acddab3e99cd83f3b317f54f7a96c32f25fd11e
url: "https://pub.dev"
source: hosted
version: "2.17.3"
version: "2.17.4"
firebase_storage:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies:
path_provider: ^2.0.3
http_parser: ^4.0.2
google_sign_in: ^6.2.1
firebase_auth: ^5.1.2
firebase_auth: ^5.1.4
firebase_core: ^3.2.0
cloud_firestore: ^5.1.0
google_maps_flutter: ^2.2.5
Expand All @@ -48,7 +48,7 @@ dependencies:
firebase_storage: ^12.1.1
usb_serial: ^0.5.2
connectivity_plus: ^6.0.3
flutter_dotenv: ^5.0.2
flutter_dotenv: ^5.1.0
cloud_firestore_platform_interface: ^6.2.9
equatable: ^2.0.5

Expand Down

0 comments on commit e4b463e

Please sign in to comment.