import 'package:flutter/material.dart';

class MyRefreshIndicator extends StatelessWidget {
  final Future<void> Function() onRefresh;
  final Widget child;
  final Color color;
  final Color backgroundColor;
  final double strokeWidth;
  final double displacement;

  const MyRefreshIndicator({
    super.key,
    required this.onRefresh,
    required this.child,
    this.color = Colors.white,
    this.backgroundColor = Colors.blueAccent,
    this.strokeWidth = 3.0,
    this.displacement = 40.0,
  });

  @override
  Widget build(BuildContext context) {
    return RefreshIndicator(
      onRefresh: onRefresh,
      color: color,
      backgroundColor: backgroundColor,
      strokeWidth: strokeWidth,
      displacement: displacement,
      child: child,
    );
  }
}
