generated from dellevin/template
动画效果美化
This commit is contained in:
28
lib/widgets/app_refresh_indicator.dart
Normal file
28
lib/widgets/app_refresh_indicator.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
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) {
|
||||
return RefreshIndicator(
|
||||
onRefresh: onRefresh,
|
||||
color: const Color(0xFF1A1A1A),
|
||||
backgroundColor: Colors.white,
|
||||
strokeWidth: 2.5,
|
||||
displacement: 60,
|
||||
semanticsLabel: semanticsLabel,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user