26 lines
658 B
Dart
26 lines
658 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
|
import 'package:lamiter/Extension/build_context.dart';
|
||
|
|
||
|
class MyRefreshIndicator extends StatelessWidget {
|
||
|
final Future<void> Function() onRefresh;
|
||
|
final List<Widget> children;
|
||
|
|
||
|
const MyRefreshIndicator({
|
||
|
super.key,
|
||
|
required this.onRefresh,
|
||
|
required this.children,
|
||
|
});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return RefreshIndicator(
|
||
|
color: context.surface,
|
||
|
backgroundColor: context.inverseSurface,
|
||
|
displacement: 6.sp,
|
||
|
onRefresh: onRefresh,
|
||
|
child: ListView(children: children),
|
||
|
);
|
||
|
}
|
||
|
}
|