feat: add env vars to repo.

This commit is contained in:
Aunali321 2022-10-17 15:06:33 +05:30
parent 2aaed14a3a
commit e55cd6a938
5 changed files with 14 additions and 17 deletions

3
.env Normal file
View File

@ -0,0 +1,3 @@
sentryDSN=${{ secrets.SENTRY_DSN }}
apiKey=${{ secrets.API_KEY }}
appId=${{ secrets.APP_ID }}

1
.gitignore vendored
View File

@ -138,6 +138,5 @@ Firebase related
.firebase
# Environment variables
.env
android/app/google-services.json
/lib/utils/env_class.g.dart

View File

@ -9,6 +9,10 @@
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
analyzer:
exclude:
- lib/utils/env_class.g.dart
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`

View File

@ -53,11 +53,11 @@ class DefaultFirebaseOptions {
}
}
static const FirebaseOptions android = FirebaseOptions(
static FirebaseOptions android = FirebaseOptions(
apiKey: Env.apiKey,
appId: Env.appId,
messagingSenderId: Env.messagingSenderId,
projectId: Env.projectId,
storageBucket: Env.storageBucket,
messagingSenderId: '1006104807752',
projectId: 'revanced-manager',
storageBucket: 'revanced-manager.appspot.com',
);
}

View File

@ -5,20 +5,11 @@ part 'env_class.g.dart';
@Envied()
abstract class Env {
@EnviedField(varName: 'sentryDSN')
static const sentryDSN = _Env.sentryDSN;
static String sentryDSN = _Env.sentryDSN;
@EnviedField(varName: 'apiKey')
static const apiKey = _Env.apiKey;
static String apiKey = _Env.apiKey;
@EnviedField(varName: 'appId')
static const appId = _Env.appId;
@EnviedField(varName: 'messagingSenderI')
static const messagingSenderId = _Env.messagingSenderId;
@EnviedField(varName: 'projectId')
static const projectId = _Env.projectId;
@EnviedField(varName: 'storageBucket')
static const storageBucket = _Env.storageBucket;
static String appId = _Env.appId;
}