1.0.17
- new appicon - smartRefreshIndicator (https://github.com/flutter/flutter/issues/65356#issuecomment-2410727567)
This commit is contained in:
28
lib/utils/SmartRefreshIndicator.dart
Normal file
28
lib/utils/SmartRefreshIndicator.dart
Normal file
@ -0,0 +1,28 @@
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user