|
@@ -15,6 +15,7 @@ import 'package:widgets/my_appbar.dart';
|
|
|
import '../../../router/page/property_page_router.dart';
|
|
|
import '../vm/property_vm.dart';
|
|
|
|
|
|
+final tabsRouterKey = GlobalKey<AutoTabsRouterState>();
|
|
|
@RoutePage()
|
|
|
class PropertyPage extends HookConsumerWidget {
|
|
|
const PropertyPage({Key? key}) : super(key: key);
|
|
@@ -95,26 +96,41 @@ class PropertyPage extends HookConsumerWidget {
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
final _vm = ref.read(propertyVmProvider.notifier);
|
|
|
final state = ref.watch(propertyVmProvider);
|
|
|
-
|
|
|
final isCollection = useState<bool>(false);
|
|
|
+
|
|
|
+ useEffect((){
|
|
|
+ WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
|
|
|
+ if(tabsRouterKey.currentState?.controller != null){
|
|
|
+ tabsRouterKey.currentState?.controller?.addListener((){
|
|
|
+ _vm.tabsRouterChange();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return (){
|
|
|
+ Log.d("CommunityPage dispose");
|
|
|
+ tabsRouterKey.currentState?.controller?.removeListener(_vm.tabsRouterChange);
|
|
|
+ };
|
|
|
+ },[]);
|
|
|
return Scaffold(
|
|
|
appBar: MyAppBar.appBar(
|
|
|
context,
|
|
|
"Property",
|
|
|
backgroundColor: context.appColors.backgroundWhite,
|
|
|
actions: [
|
|
|
- MyAssetImage(
|
|
|
+ state.currentPageViewIdx == 1? MyAssetImage(
|
|
|
isCollection.value? Assets.propertyCollectionActive: Assets.propertyCollection,
|
|
|
width: 22.5,
|
|
|
height: 21,
|
|
|
).onTap((){
|
|
|
isCollection.value = !isCollection.value;
|
|
|
_vm.handlerCollectionFilter(context,isCollection.value);
|
|
|
- }),
|
|
|
+ }):Container(),
|
|
|
const SizedBox(width: 20),
|
|
|
],
|
|
|
),
|
|
|
body: AutoTabsRouter.pageView(
|
|
|
+ key: tabsRouterKey,
|
|
|
routes: const [
|
|
|
PropertyIoanPageRoute(),
|
|
|
PropertyNewsPageRoute(),
|