lifecycle
lifecycle copied to clipboard
ChildPageLifecycleWrapper 包裹的widget,with了LifecycleAware,收不到生命周期回调
代码如
PageViewLifecycleWrapper( // Outer PageView
child: PageView(
controller: pageController,
physics: NeverScrollableScrollPhysics(),
children: [
FixedChildPageLifecycleWrapper(
index: 0,
wantKeepAlive: true,child: AWidget()),
class AWdiget extends StatefulWidget {
createState() => _State();
}
class _State<T extends StatefulWidget> extends State<T>
with LifecycleAware, LifecycleMixin<T>,
如果是单独push这个widget是能收到回调的