EasyLoading接口测试
This commit is contained in:
parent
ef4937ad6d
commit
a4f3cc58c9
|
@ -1,4 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import 'bookmarks_controller.dart';
|
import 'bookmarks_controller.dart';
|
||||||
|
@ -9,8 +10,18 @@ class BookmarksPage extends GetView<BookmarksController> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Container(
|
child: Column(
|
||||||
child: Text('BookmarksPage'),
|
children: [
|
||||||
|
Text('BookmarksPage'),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
// EasyLoading.showProgress(0.3, status: 'downloading...');
|
||||||
|
// EasyLoading.showToast("1231232");
|
||||||
|
EasyLoading.show(status: "Loading");
|
||||||
|
},
|
||||||
|
child: Text("Test"),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,20 +4,27 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
class Loading {
|
class Loading {
|
||||||
Loading() {
|
Loading() {
|
||||||
// 调整loading的配置
|
// 调整loading的配置
|
||||||
|
// 预览参考 https://nslogx.github.io/flutter_easyloading/#/
|
||||||
EasyLoading.instance
|
EasyLoading.instance
|
||||||
|
// 只作用提示 不作用与loading
|
||||||
..displayDuration = const Duration(milliseconds: 2000)
|
..displayDuration = const Duration(milliseconds: 2000)
|
||||||
|
// loading调整
|
||||||
..indicatorType = EasyLoadingIndicatorType.ring
|
..indicatorType = EasyLoadingIndicatorType.ring
|
||||||
..loadingStyle = EasyLoadingStyle.custom
|
..loadingStyle = EasyLoadingStyle.custom
|
||||||
..indicatorSize = 35.0
|
..indicatorSize = 35.0
|
||||||
..lineWidth = 2
|
..lineWidth = 2
|
||||||
..radius = 10.0
|
..radius = 10.0
|
||||||
|
// 颜色调整
|
||||||
..progressColor = Colors.white
|
..progressColor = Colors.white
|
||||||
..backgroundColor = Colors.black.withOpacity(0.7)
|
..backgroundColor = Colors.black.withOpacity(0.7)
|
||||||
..indicatorColor = Colors.white
|
..indicatorColor = Colors.white
|
||||||
..textColor = Colors.white
|
..textColor = Colors.white
|
||||||
..maskColor = Colors.black.withOpacity(0.6)
|
..maskColor = Colors.black.withOpacity(0.6)
|
||||||
|
// 是否在loading是可交互
|
||||||
..userInteractions = true
|
..userInteractions = true
|
||||||
|
// 是否用户点击取消提示 只作用提示 不作用与loading
|
||||||
..dismissOnTap = false
|
..dismissOnTap = false
|
||||||
|
// 遮罩类型
|
||||||
..maskType = EasyLoadingMaskType.custom;
|
..maskType = EasyLoadingMaskType.custom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue