hhlifecycle_flutter

Last updated:

0 purchases

hhlifecycle_flutter Image
hhlifecycle_flutter Images
Add to Cart

Description:

hhlifecycle flutter

已知问题:存在不继承LifeCycleBaseState的widget,onPause onResume也会走,如果有页面不继承请自行判断当前路由
使用方法
class _Page1State extends LifeCycleBaseState<Page2> {

@override
Widget onBuild(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Page2"),
),
body: Center(
child: InkWell(
onTap: (){
Get.to(Page2(),preventDuplicates: false);
},
child: const Text(
"Page2"
),
),
),
);
}

@override
void onStart() {
// TODO: implement onStart
super.onStart();
}

@override
void onDestory() {
// TODO: implement onDestory
super.onDestory();
}

@override
void onPause() {
// TODO: implement onPause
super.onPause();
}

@override
void onResume() {
// TODO: implement onResume
super.onResume();
}
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.