36 lines
1.0 KiB
Dart
36 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
|
|
class Loading {
|
|
static void configLoading() {
|
|
EasyLoading.instance
|
|
..displayDuration = const Duration(milliseconds: 4000)
|
|
..loadingStyle = EasyLoadingStyle.custom
|
|
..indicatorSize = 45.0
|
|
..radius = 550.0
|
|
..progressColor = Colors.yellow
|
|
..backgroundColor = Colors.transparent
|
|
..indicatorColor = Colors.yellow
|
|
..textColor = Colors.yellow
|
|
..maskColor = Colors.white.withOpacity(0.85)
|
|
..boxShadow = []
|
|
..contentPadding = const EdgeInsets.symmetric(vertical: 20.0, horizontal: 20.0)
|
|
..userInteractions = false
|
|
..dismissOnTap = false
|
|
..animationStyle = EasyLoadingAnimationStyle.scale;
|
|
|
|
//..customAnimation = CustomAnimation();
|
|
}
|
|
}
|
|
|
|
void showLoading({bool isDismissOnTap = false}) {
|
|
EasyLoading.show(
|
|
maskType: EasyLoadingMaskType.custom,
|
|
dismissOnTap: isDismissOnTap,
|
|
);
|
|
}
|
|
|
|
void hideLoading() {
|
|
EasyLoading.dismiss();
|
|
}
|