import 'dart:async';

import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';

class BaseEasyRefresh extends StatelessWidget {
  final EasyRefreshController? controller;
  final bool noMoreRefresh;
  final bool noMoreLoad;
  final bool refreshOnStart;
  final Header? header;
  final Footer? footer;
  final FutureOr Function()? onRefresh;
  final FutureOr Function()? onLoad;
  final Widget child;

  const BaseEasyRefresh({
    super.key,
    this.controller,
    this.noMoreRefresh = false,
    this.noMoreLoad = false,
    this.refreshOnStart = false,
    this.header,
    this.footer,
    required this.child,
    this.onRefresh,
    this.onLoad,
  });

  @override
  Widget build(BuildContext context) {
    return EasyRefresh(
      refreshOnStart: refreshOnStart,
      controller: controller,
      header: header,
      footer: footer,
      onRefresh: onRefresh,
      onLoad: onLoad,
      child: child,
    );
  }
}
