|
@@ -9,6 +9,7 @@ import 'package:router/ext/auto_router_extensions.dart';
|
|
|
import 'package:shared/utils/color_utils.dart';
|
|
|
import 'package:widgets/load_state_layout.dart';
|
|
|
import 'package:widgets/my_appbar.dart';
|
|
|
+import 'package:widgets/my_load_image.dart';
|
|
|
import 'package:widgets/my_text_view.dart';
|
|
|
|
|
|
@RoutePage()
|
|
@@ -31,6 +32,7 @@ class GaragesaleDetailPage extends HookConsumerWidget {
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
final state = ref.watch(garagesaleDetailVmProvider);
|
|
|
final vm = ref.read(garagesaleDetailVmProvider.notifier);
|
|
|
+ final String pageTitle = (type == 'forsale') ? 'For Sale' :'For Rent';
|
|
|
|
|
|
useEffect((){
|
|
|
// 组件挂载时执行 - 执行接口请求
|
|
@@ -43,7 +45,7 @@ class GaragesaleDetailPage extends HookConsumerWidget {
|
|
|
return Scaffold(
|
|
|
appBar: MyAppBar.appBar(
|
|
|
context,
|
|
|
- "Garage Sale Detail",
|
|
|
+ pageTitle,
|
|
|
backgroundColor: context.appColors.whiteBG,
|
|
|
),
|
|
|
backgroundColor: context.appColors.backgroundDefault,
|
|
@@ -77,44 +79,75 @@ class GaragesaleDetailPage extends HookConsumerWidget {
|
|
|
|
|
|
Widget _buildContentBox(BuildContext context, WidgetRef ref) {
|
|
|
final vm = ref.read(garagesaleDetailVmProvider.notifier);
|
|
|
+ final state = ref.watch(garagesaleDetailVmProvider);
|
|
|
+ String title = state.datas!['title'] ?? '';
|
|
|
+ String price = state.datas!['price'] ?? '';
|
|
|
+ String description = state.datas!['description'] ?? '';
|
|
|
return Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Container(
|
|
|
- color: context.appColors.whiteBG,
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- color: context.appColors.whiteBG,
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- color: context.appColors.whiteBG,
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- color: context.appColors.whiteBG,
|
|
|
- )
|
|
|
- ]
|
|
|
- )
|
|
|
- )
|
|
|
- ]
|
|
|
- )
|
|
|
- )
|
|
|
- ]
|
|
|
- )
|
|
|
- )
|
|
|
+ // 图片
|
|
|
+ SizedBox(
|
|
|
+ width: double.infinity,
|
|
|
+ height: 173.5,
|
|
|
+ child: MyLoadImage(
|
|
|
+ state.datas!['goods_img'],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ // 标题
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 16, top: 16,),
|
|
|
+ child: title.isNotEmpty? MyTextView( title, fontSize: 18, isFontMedium: true, textColor: context.appColors.textBlack,):const SizedBox.shrink(),
|
|
|
+ ),
|
|
|
+ // 价格
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 16, top: 10),
|
|
|
+ child: price.isNotEmpty? MyTextView( price, fontSize: 24, isFontMedium: true, textColor: context.appColors.textBlack,):const SizedBox.shrink(),
|
|
|
+ ),
|
|
|
+ // 内容
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
|
|
|
+ child: description.isNotEmpty? MyTextView( description, fontSize: 17, isFontRegular: true, textColor: context.appColors.textBlack,):const SizedBox.shrink(),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+
|
|
|
]
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget _buildBottomConcatInfo(BuildContext context, WidgetRef ref) {
|
|
|
+ final state = ref.watch(garagesaleDetailVmProvider);
|
|
|
+ String publisher = state.datas!['publisher'] ?? '';
|
|
|
+ String publisherAvatar = state.datas!['publisher_avatar'] ?? '';
|
|
|
+ String publisherTime = state.datas!['publisher_time'] ?? '';
|
|
|
+ int collectionNum = state.datas!['collection_num'] ?? 0;
|
|
|
return Container(
|
|
|
height: 50,
|
|
|
color: ColorUtils.string2Color('#4161D0'),
|
|
|
child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
children: [
|
|
|
- // MyLoadImage(Assets.propertyIoanItemBg,width: 60,height: 50,),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ MyLoadImage(
|
|
|
+ publisherAvatar,
|
|
|
+ width: 29,
|
|
|
+ height: 29,
|
|
|
+ isCircle: true,
|
|
|
+ ),
|
|
|
+ Column(
|
|
|
+ children: [
|
|
|
+ MyTextView(publisher, fontSize:12, textColor: context.appColors.textWhite,)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Row(),
|
|
|
+
|
|
|
const SizedBox(width: 10,),
|
|
|
MyTextView(
|
|
|
"Request a Quote",
|