Skip to content

Commit

Permalink
Initialized remote config main
Browse files Browse the repository at this point in the history
  • Loading branch information
pawan2806 committed Mar 26, 2021
1 parent dec3c6e commit 6f74f0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'services/remote_config.dart';
import 'package:retro_shopping/helpers/ad_state.dart';
import 'package:retro_shopping/helpers/constants.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';
import 'package:retro_shopping/helpers/route_page.dart';

RemoteConfigService _remoteConfigService;
Future<void> main() async {

//firebase Initialization
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
//AdMob Initialization
final Future<InitializationStatus> initFuture =
MobileAds.instance.initialize();

//Initialize remote config
_remoteConfigService= await RemoteConfigService.getInstance();
await _remoteConfigService.initialize();

final AdState adState = AdState(initFuture);

runApp(
Expand Down
4 changes: 2 additions & 2 deletions lib/services/remote_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class RemoteConfigService {
}

bool get getBoolValue=>_remoteConfig.getBool(_BOOLEAN_VALUE);
bool get getIntValue=>_remoteConfig.getBool(_INT_VALUE);
bool get getStringValue=>_remoteConfig.getBool(_STRING_VALUE);
int get getIntValue=>_remoteConfig.getInt(_INT_VALUE);
String get getStringValue=>_remoteConfig.getString(_STRING_VALUE);

Future initialize() async {
try {
Expand Down

0 comments on commit 6f74f0b

Please sign in to comment.