You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
import 'package:flutter/material.dart';
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
|
|
class Loading {
|
|
Loading() {
|
|
EasyLoading.instance
|
|
..displayDuration = const Duration(milliseconds: 2000)
|
|
..indicatorType = EasyLoadingIndicatorType.ring
|
|
..loadingStyle = EasyLoadingStyle.custom
|
|
..indicatorSize = 35.0
|
|
..lineWidth = 2
|
|
..radius = 10.0
|
|
..progressColor = Colors.white
|
|
..backgroundColor = Colors.black.withOpacity(0.7)
|
|
..indicatorColor = Colors.white
|
|
..textColor = Colors.white
|
|
..maskColor = Colors.black.withOpacity(0.6)
|
|
..userInteractions = true
|
|
..dismissOnTap = false
|
|
..maskType = EasyLoadingMaskType.custom;
|
|
}
|
|
|
|
static void show([String? text]) {
|
|
EasyLoading.instance.userInteractions = false;
|
|
EasyLoading.show(status: text ?? 'Loading...');
|
|
}
|
|
|
|
static void toast(String text) {
|
|
EasyLoading.showToast(text);
|
|
}
|
|
|
|
static void dismiss() {
|
|
EasyLoading.instance.userInteractions = true;
|
|
EasyLoading.dismiss();
|
|
}
|
|
}
|