38 lines
855 B
Dart
38 lines
855 B
Dart
import 'package:easy_refresh/easy_refresh.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:skywood/main/lib_file.dart';
|
|
|
|
/// 自定义 GIF Header
|
|
class GifHeader extends Header {
|
|
const GifHeader({
|
|
super.triggerOffset = 80,
|
|
super.clamping = false,
|
|
this.height = 80,
|
|
this.size = 74,
|
|
});
|
|
|
|
final double height;
|
|
final double size;
|
|
|
|
@override
|
|
Widget build(BuildContext context, IndicatorState state) {
|
|
if (state.mode == IndicatorMode.inactive ||
|
|
state.mode == IndicatorMode.processed ||
|
|
state.mode == IndicatorMode.done) {
|
|
return const SizedBox.shrink();
|
|
}
|
|
|
|
return SizedBox(
|
|
height: height,
|
|
child: Center(
|
|
child: Image.asset(
|
|
ConstImg.loading,
|
|
width: size,
|
|
height: size,
|
|
fit: BoxFit.contain,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|