Merge pull request 'Implemented pull down refresh widget' (#3) from Vaibhav_Task-#118 into main

Reviewed-on: #3
This commit is contained in:
vaibhav.surve 2025-04-28 06:12:34 +00:00
commit 9fbf82b05c

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,
),
);
}
}