Implemented pull down refresh widget

This commit is contained in:
Vaibhav Surve 2025-04-28 11:41:49 +05:30
parent 581efaff34
commit f01eb81255

View File

@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
class MyRefreshWrapper extends StatelessWidget {
final Future<void> Function() onRefresh;
final Widget child;
final EdgeInsetsGeometry? padding;
const MyRefreshWrapper({
Key? key,
required this.onRefresh,
required this.child,
this.padding,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return RefreshIndicator(
onRefresh: onRefresh,
backgroundColor: Colors.red, // Set background color to red
color: Colors.white, // Set spinner color to white
child: SingleChildScrollView(
padding: padding,
physics: const AlwaysScrollableScrollPhysics(),
child: child,
),
);
}
}