Implemented pull down refresh widget
This commit is contained in:
parent
581efaff34
commit
f01eb81255
28
lib/helpers/widgets/my_refresh_wrapper.dart
Normal file
28
lib/helpers/widgets/my_refresh_wrapper.dart
Normal 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,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user