forked from dscnitrourkela/project-maple
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup remote config for ApiUrl and ApiKey
- Loading branch information
1 parent
0a8e908
commit 155db44
Showing
6 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:firebase_remote_config/firebase_remote_config.dart'; | ||
|
||
class RemoteConfigService { | ||
late RemoteConfig remoteConfig; | ||
Future<RemoteConfig> setupRemoteConfig() async { | ||
try { | ||
remoteConfig = RemoteConfig.instance; | ||
remoteConfig.setDefaults(<String, dynamic>{ | ||
'api_url': 'https://aptiche.dscnitrourkela.org/graphql', | ||
'api_key': 'SriramForTheDiro' | ||
}); | ||
await remoteConfig.ensureInitialized(); | ||
await remoteConfig.fetchAndActivate(); | ||
|
||
return remoteConfig; | ||
} catch (e) { | ||
rethrow; | ||
} | ||
} | ||
|
||
String get apiUrl => remoteConfig.getString('api_url'); | ||
|
||
String get apiKey => remoteConfig.getString('api_key'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters