基础组件库
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

refresh_header.dart 984 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:flutter/material.dart';
  2. import 'package:loading_indicator/loading_indicator.dart';
  3. import 'package:pull_to_refresh/pull_to_refresh.dart';
  4. class RefreshHeader extends StatelessWidget {
  5. final double offsetY;
  6. final double _height = 44;
  7. final Color color;
  8. const RefreshHeader({Key key, this.offsetY = 0,this.color=Colors.white}) : super(key: key);
  9. @override
  10. Widget build(BuildContext context) {
  11. // double top = MediaQueryData.fromWindow(window).padding.top;
  12. return CustomHeader(
  13. height: _height,
  14. builder: (BuildContext context, RefreshStatus mode) {
  15. return Transform.translate(
  16. offset: Offset(0, offsetY),
  17. child: Center(
  18. child: Container(
  19. width: 36,
  20. height: 36,
  21. child: LoadingIndicator(
  22. indicatorType: Indicator.ballSpinFadeLoader,
  23. color: color,
  24. ),
  25. ),
  26. ),
  27. );
  28. },
  29. );
  30. }
  31. }