feat:新增防抖工具类
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
|
||||
// import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
|
||||
import 'package:transparent_image/transparent_image.dart';
|
||||
|
||||
|
||||
|
||||
|
||||
///字体样式
|
||||
class CustomerTextStyle extends TextStyle {
|
||||
final Color? customerColor;
|
||||
@@ -160,6 +158,25 @@ class CustomerImagesNetworking extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 防抖工具
|
||||
class DebounceUtils {
|
||||
/// 防抖时间间隔,默认 500 毫秒
|
||||
static const Duration defaultInterval = Duration(milliseconds: 500);
|
||||
|
||||
/// 防抖方法
|
||||
static void debounce(
|
||||
String key,
|
||||
VoidCallback action, {
|
||||
Duration interval = defaultInterval,
|
||||
}) {
|
||||
EasyDebounce.debounce(
|
||||
key, //
|
||||
interval,
|
||||
() => action
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
///money字体样式
|
||||
class CustomerMoneyText extends StatelessWidget {
|
||||
final String money;
|
||||
|
||||
Reference in New Issue
Block a user