基础组件库
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 947 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. const RefreshHeader({Key key, this.offsetY = 0}) : super(key: key);
  8. @override
  9. Widget build(BuildContext context) {
  10. // double top = MediaQueryData.fromWindow(window).padding.top;
  11. return CustomHeader(
  12. height: _height,
  13. builder: (BuildContext context, RefreshStatus mode) {
  14. return Transform.translate(
  15. offset: Offset(0, offsetY),
  16. child: Center(
  17. child: Container(
  18. width: 36,
  19. height: 36,
  20. child: LoadingIndicator(
  21. indicatorType: Indicator.ballSpinFadeLoader,
  22. color: Colors.white,
  23. ),
  24. ),
  25. ),
  26. );
  27. },
  28. );
  29. }
  30. }