import 'package:flutter/material.dart';
import 'package:loading_indicator/loading_indicator.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

class RefreshGifHeader extends StatelessWidget {
  final double offsetY;
  // final double _height = 50;

  const RefreshGifHeader({Key key, this.offsetY = 0}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // double top = MediaQueryData.fromWindow(window).padding.top;
    return CustomHeader(
      // height: _height,
      builder: (BuildContext context, RefreshStatus mode) {
        return Transform.translate(
          offset: Offset(0, offsetY),
          child: Center(
            child: Container(
              // color: Colors.white,
              alignment: Alignment.center,
              height: 50,
              child: Image.asset(
                'assets/images/loading/loading.gif',
                package: 'zhiying_base_widget',
              ),
            ),
          ),
        );
      },
    );
  }
}
