Files
MookNote/lib/widgets/app_refresh_indicator.dart
2026-05-26 05:10:21 +08:00

30 lines
728 B
Dart

import 'package:flutter/material.dart';
/// 自定义下拉刷新包装器 — 统一使用品牌色
class AppRefreshIndicator extends StatelessWidget {
final Future<void> Function() onRefresh;
final Widget child;
final String? semanticsLabel;
const AppRefreshIndicator({
super.key,
required this.onRefresh,
required this.child,
this.semanticsLabel,
});
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
return RefreshIndicator(
onRefresh: onRefresh,
color: colors.primary,
backgroundColor: colors.surface,
strokeWidth: 2.5,
displacement: 60,
semanticsLabel: semanticsLabel,
child: child,
);
}
}