fApp/lib/utils/smartrefreshindicator.dart
Flummi 14081489cc
All checks were successful
Flutter Schmutter / build (push) Successful in 3m54s
v1.3.0+56
2025-06-16 15:05:39 +02:00

29 lines
698 B
Dart

import 'package:flutter/material.dart';
class SmartRefreshIndicator extends StatelessWidget {
final Future<void> Function() onRefresh;
final Widget child;
const SmartRefreshIndicator({
super.key,
required this.onRefresh,
required this.child,
});
@override
Widget build(context) {
return LayoutBuilder(
builder: (context, constraints) => RefreshIndicator(
onRefresh: onRefresh,
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
child: ConstrainedBox(
constraints: BoxConstraints(minHeight: constraints.maxHeight),
child: child,
),
),
),
);
}
}