基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

refresh_header.dart 984 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
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. }