EasyLoading接口测试
This commit is contained in:
parent
ef4937ad6d
commit
a4f3cc58c9
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'bookmarks_controller.dart';
|
||||
|
@ -9,8 +10,18 @@ class BookmarksPage extends GetView<BookmarksController> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Container(
|
||||
child: Text('BookmarksPage'),
|
||||
child: Column(
|
||||
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 {
|
||||
Loading() {
|
||||
// 调整loading的配置
|
||||
// 预览参考 https://nslogx.github.io/flutter_easyloading/#/
|
||||
EasyLoading.instance
|
||||
// 只作用提示 不作用与loading
|
||||
..displayDuration = const Duration(milliseconds: 2000)
|
||||
// loading调整
|
||||
..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)
|
||||
// 是否在loading是可交互
|
||||
..userInteractions = true
|
||||
// 是否用户点击取消提示 只作用提示 不作用与loading
|
||||
..dismissOnTap = false
|
||||
// 遮罩类型
|
||||
..maskType = EasyLoadingMaskType.custom;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue