parent
9bf3a7dd8a
commit
c6883718b4
@ -0,0 +1,31 @@
|
|||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
import 'package:aku_community/model/common/img_model.dart';
|
||||||
|
|
||||||
|
part 'goods_item.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class GoodsItem extends Equatable {
|
||||||
|
final int id;
|
||||||
|
final String title;
|
||||||
|
final String recommend;
|
||||||
|
final num sellingPrice;
|
||||||
|
final num markingPrice;
|
||||||
|
final int subscribeNum;
|
||||||
|
final List<ImgModel> imgList;
|
||||||
|
GoodsItem({
|
||||||
|
required this.id,
|
||||||
|
required this.title,
|
||||||
|
required this.recommend,
|
||||||
|
required this.sellingPrice,
|
||||||
|
required this.markingPrice,
|
||||||
|
required this.subscribeNum,
|
||||||
|
required this.imgList,
|
||||||
|
});
|
||||||
|
@override
|
||||||
|
List<Object?> get props => throw UnimplementedError();
|
||||||
|
|
||||||
|
factory GoodsItem.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$GoodsItemFromJson(json);
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'goods_item.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
GoodsItem _$GoodsItemFromJson(Map<String, dynamic> json) {
|
||||||
|
return GoodsItem(
|
||||||
|
id: json['id'] as int,
|
||||||
|
title: json['title'] as String,
|
||||||
|
recommend: json['recommend'] as String,
|
||||||
|
sellingPrice: json['sellingPrice'] as num,
|
||||||
|
markingPrice: json['markingPrice'] as num,
|
||||||
|
subscribeNum: json['subscribeNum'] as int,
|
||||||
|
imgList: (json['imgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
}
|
@ -1,100 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:waterfall_flow/waterfall_flow.dart';
|
|
||||||
|
|
||||||
import 'package:aku_community/ui/market/goods/goods_card.dart';
|
|
||||||
import 'package:aku_community/ui/market/goods/goods_list_view.dart';
|
|
||||||
import 'package:aku_community/utils/headers.dart';
|
|
||||||
|
|
||||||
@Deprecated('NO NEED THIS CLASS IN FUTURE')
|
|
||||||
class MarketData {
|
|
||||||
final String name;
|
|
||||||
final String path;
|
|
||||||
MarketData({
|
|
||||||
required this.name,
|
|
||||||
required this.path,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('NO NEED THIS LIST IN FUTURE')
|
|
||||||
List<MarketData> mockableMarketData = [
|
|
||||||
MarketData(name: '居家生活', path: R.ASSETS_ICONS_TOOL_JJSH_PNG),
|
|
||||||
MarketData(name: '数码家电', path: R.ASSETS_ICONS_TOOL_SMJD_PNG),
|
|
||||||
MarketData(name: '休闲副食', path: R.ASSETS_ICONS_TOOL_XXFS_PNG),
|
|
||||||
MarketData(name: '滋补保健', path: R.ASSETS_ICONS_TOOL_ZBBJ_PNG),
|
|
||||||
MarketData(name: '彩妆香水', path: R.ASSETS_ICONS_TOOL_CZXS_PNG),
|
|
||||||
MarketData(name: '服饰箱包', path: R.ASSETS_ICONS_TOOL_FSXB_PNG),
|
|
||||||
MarketData(name: '母婴玩具', path: R.ASSETS_ICONS_TOOL_MYWJ_PNG),
|
|
||||||
MarketData(name: '饮料酒水', path: R.ASSETS_ICONS_TOOL_YLJS_PNG),
|
|
||||||
];
|
|
||||||
|
|
||||||
@Deprecated('NO NEED THIS WIDGET IN FUTURE')
|
|
||||||
class MockableMarketWidget extends StatelessWidget {
|
|
||||||
final MarketData data;
|
|
||||||
const MockableMarketWidget({Key? key, required this.data}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return MaterialButton(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Spacer(),
|
|
||||||
Image.asset(
|
|
||||||
data.path,
|
|
||||||
height: 75.w,
|
|
||||||
width: 75.w,
|
|
||||||
),
|
|
||||||
12.hb,
|
|
||||||
Text(
|
|
||||||
data.name,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 24.sp,
|
|
||||||
color: Color(0xFF4A4B51),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Spacer(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
Get.to(
|
|
||||||
() => GoodsListView(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('NO NEED THIS WIDGET IN FUTURE')
|
|
||||||
class MockableMarketList extends StatefulWidget {
|
|
||||||
MockableMarketList({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_MockableMarketListState createState() => _MockableMarketListState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MockableMarketListState extends State<MockableMarketList> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return EasyRefresh(
|
|
||||||
header: MaterialHeader(completeDuration: Duration(milliseconds: 300)),
|
|
||||||
onRefresh: () async {},
|
|
||||||
child: WaterfallFlow(
|
|
||||||
padding: EdgeInsets.all(32.w),
|
|
||||||
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 2,
|
|
||||||
mainAxisSpacing: 20.w,
|
|
||||||
crossAxisSpacing: 20.w,
|
|
||||||
),
|
|
||||||
children: [
|
|
||||||
GoodsCard(),
|
|
||||||
GoodsCard(),
|
|
||||||
GoodsCard(),
|
|
||||||
GoodsCard(),
|
|
||||||
GoodsCard(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue