Skip to content

Commit

Permalink
🎨 Improve Loading config
Browse files Browse the repository at this point in the history
  • Loading branch information
rexthecoder committed Nov 6, 2021
1 parent d8a68af commit caf8f12
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/src/app/intializer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,37 @@

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:loggy/loggy.dart';
import 'package:news360/src/logic/authentication/auth_configuration.dart';
import 'package:news360/src/logic/authentication/authentication_controller.dart';
import 'package:news360/src/logic/logic.dart';
import 'package:news360/src/presentation/theme/theme.dart';

Future<void> init() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await GetStorage.init();

Loggy.initLoggy();
configLoading();
// injecting the controller for auth state.
Get.lazyPut<AuthenticationController>(
() => AuthenticationController(
AuthConfiguration(),
),
);
}

void configLoading() {
EasyLoading.instance
..loadingStyle = isDarkMode ? EasyLoadingStyle.light : EasyLoadingStyle.dark
..indicatorSize = 45.0
..radius = 10.0
..maskColor = AppColors.purplePrimary.withOpacity(0.5)
..maskType = EasyLoadingMaskType.black
..userInteractions = false
..dismissOnTap = false;
}

0 comments on commit caf8f12

Please sign in to comment.