update goods detail page

hmxc
小赖 4 years ago
parent e26b7712a0
commit 68b47e2939

@ -15,7 +15,7 @@ class GoodsCard extends StatelessWidget {
color: Colors.white, color: Colors.white,
elevation: 0, elevation: 0,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: () => Get.to(() => GoodsDetailPage()), onPressed: () => Get.to(() => GoodsDetailPage(id: 0)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -2,8 +2,12 @@ import 'package:flutter/material.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
///
class GoodsDetailPage extends StatefulWidget { class GoodsDetailPage extends StatefulWidget {
GoodsDetailPage({Key? key}) : super(key: key); ///ID
final int id;
GoodsDetailPage({Key? key, required this.id}) : super(key: key);
@override @override
_GoodsDetailPageState createState() => _GoodsDetailPageState(); _GoodsDetailPageState createState() => _GoodsDetailPageState();

@ -1,6 +1,8 @@
import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:waterfall_flow/waterfall_flow.dart'; import 'package:waterfall_flow/waterfall_flow.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
@ -35,7 +37,12 @@ class _GoodsTabListViewState extends State<GoodsTabListView>
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final GoodsItem item = items[index]; final GoodsItem item = items[index];
return Text(item.title); return MaterialButton(
onPressed: () {
Get.to(() => GoodsDetailPage(id: widget.model.id));
},
child: Text(item.title),
);
}, },
itemCount: items.length, itemCount: items.length,
); );

Loading…
Cancel
Save