Is there a way to get the Cert on runtime?, so I can use it on Restricted Google Maps API Key as Request Header.
Ref: Google Maps API Key Android Restrict Usage
Currently I define it on .env
and generate the obfuscated cert using envied package.
import 'package:envied/envied.dart';
part 'envs.g.dart';
/// Environment variables from `.env` file.
@Envied(useConstantCase: true, allowOptionalFields: true)
abstract class Envs {
/// Decides whether to use hash URL or not on Web.
@EnviedField()
static const bool isNoHashUrl = _Envs.isNoHashUrl;
/// Google Maps API Key for development.
@EnviedField(defaultValue: '')
static const String debugGmapsApiKey = _Envs.debugGmapsApiKey;
/// Android/IOS bundle id.
@EnviedField()
static const String appBundleId = _Envs.appBundleId;
/// Android 20-byte SHA-1 certificate fingerprint.
///
/// Used on Google Maps API Request Header for Restricted API Key.
///
/// If someone know how to get this on flutter runtime, please let me know.
@EnviedField(obfuscate: true)
static final String androidCert = _Envs.androidCert;
}