23 lines
527 B
Dart
Executable File
23 lines
527 B
Dart
Executable File
import 'package:flutter/material.dart';
|
|
|
|
class KRKeepAliveWrapper extends StatefulWidget {
|
|
final Widget child;
|
|
|
|
const KRKeepAliveWrapper(this.child, {Key? key}) : super(key: key);
|
|
|
|
@override
|
|
_KeepAliveWrapperState createState() => _KeepAliveWrapperState();
|
|
}
|
|
|
|
class _KeepAliveWrapperState extends State<KRKeepAliveWrapper>
|
|
with AutomaticKeepAliveClientMixin {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
super.build(context);
|
|
return widget.child;
|
|
}
|
|
|
|
@override
|
|
bool get wantKeepAlive => true;
|
|
}
|