|
@@ -8,8 +8,10 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
import 'package:router/ext/auto_router_extensions.dart';
|
|
|
import 'package:shared/utils/color_utils.dart';
|
|
|
+import 'package:shared/utils/log_utils.dart';
|
|
|
import 'package:widgets/load_state_layout.dart';
|
|
|
import 'package:widgets/my_appbar.dart';
|
|
|
+import 'package:widgets/my_like_button.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
|
import 'package:widgets/my_text_view.dart';
|
|
|
|
|
@@ -34,7 +36,7 @@ class GaragesaleDetailPage extends HookConsumerWidget {
|
|
|
final state = ref.watch(garagesaleDetailVmProvider);
|
|
|
final vm = ref.read(garagesaleDetailVmProvider.notifier);
|
|
|
final String pageTitle = (type == 'forSale') ? 'For Sale' :'For Rent';
|
|
|
-
|
|
|
+ GlobalKey _likeButtonKey = GlobalKey<MyLikeButtonState>();
|
|
|
useEffect((){
|
|
|
// 组件挂载时执行 - 执行接口请求
|
|
|
Future.microtask(() => vm.initPageData());
|
|
@@ -78,7 +80,7 @@ class GaragesaleDetailPage extends HookConsumerWidget {
|
|
|
// 底部联系信息
|
|
|
Visibility(
|
|
|
visible: state.loadingState == LoadState.State_Success,
|
|
|
- child: _buildBottomConcatInfo(context, ref),
|
|
|
+ child: _buildBottomConcatInfo(context, ref, _likeButtonKey),
|
|
|
)
|
|
|
],
|
|
|
),
|
|
@@ -143,7 +145,7 @@ class GaragesaleDetailPage extends HookConsumerWidget {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget _buildBottomConcatInfo(BuildContext context, WidgetRef ref) {
|
|
|
+ Widget _buildBottomConcatInfo(BuildContext context, WidgetRef ref, likeButtonKey) {
|
|
|
final state = ref.watch(garagesaleDetailVmProvider);
|
|
|
String publisher = state.datas!['publisher'] ?? '';
|
|
|
String contactType = state.datas!['contactType'] ?? '';
|
|
@@ -185,15 +187,40 @@ class GaragesaleDetailPage extends HookConsumerWidget {
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
children: [
|
|
|
- const MyAssetImage(Assets.communityCollection, width: 18,height: 18,),
|
|
|
- MyTextView(
|
|
|
- "$collectionNum",
|
|
|
- fontSize: 18,
|
|
|
- textColor: Colors.white,
|
|
|
- isFontRegular: true,
|
|
|
- marginLeft: 5,
|
|
|
- marginRight: 15,
|
|
|
+ Container(
|
|
|
+ alignment: Alignment.center,
|
|
|
+ padding: const EdgeInsets.only(left:5, right: 0,top:5,bottom: 5),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyLikeButton(
|
|
|
+ key: likeButtonKey,
|
|
|
+ isLiked: false,
|
|
|
+ isCustomIcon: true,
|
|
|
+ customIconUnActiveAssets: Assets.communityCollection,
|
|
|
+ customIconActiveAssets: Assets.communityLikeActive,
|
|
|
+ // customIconWidth: 18,
|
|
|
+ // customIconHeight: 18,
|
|
|
+ onLike: () {
|
|
|
+ Log.d('点击了like button');
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ MyTextView(
|
|
|
+ "$collectionNum",
|
|
|
+ fontSize: 18,
|
|
|
+ textColor: Colors.white,
|
|
|
+ isFontRegular: true,
|
|
|
+ marginLeft: 5,
|
|
|
+ marginRight: 15,
|
|
|
+ onClick: (){
|
|
|
+ final state = likeButtonKey.currentState;
|
|
|
+ state?.triggerTap();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
+ // const MyAssetImage(Assets.communityCollection, width: 18,height: 18,),
|
|
|
Visibility(
|
|
|
visible: contactType == 'Mobile Phone',
|
|
|
child: const Row(
|