基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_page.dart 2.7 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_item_single.dart';
  3. import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart';
  4. import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_style_model.dart';
  5. import 'package:zhiying_comm/util/net_util.dart';
  6. class TestPage extends StatefulWidget {
  7. @override
  8. _TestPageState createState() => _TestPageState();
  9. }
  10. class _TestPageState extends State<TestPage> {
  11. List<HomeGoodsModel> _goods;
  12. HomeGoodsStyleModel _styleModel;
  13. @override
  14. void initState() {
  15. // NetUtil.request('/api/v1/rec/featured?page=3', method: NetMethod.GET,
  16. // onSuccess: (data) {
  17. // List goods = data['good'];
  18. // _styleModel = HomeGoodsStyleModel(
  19. // listColumn: '1',
  20. // // recommendList,
  21. // providerNameColor: '#ffffff',
  22. // providerNameBackgroundColor: '#ff4242',
  23. // shopNameColor: '#ffffff',
  24. // shopIcon: '',
  25. // couponFontColor: '#ffffff',
  26. // couponBgColor: '#ff4242',
  27. // commissionFontColor: '#ffffff',
  28. // commissionBgColor: '#ff4242',
  29. // marketPriceColor: '#ffffff',
  30. // currentPriceColor: '#ff4242',
  31. // );
  32. // _goods = goods.map((e) {
  33. // return HomeGoodsModel.fromJson(Map<String, dynamic>.from(e));
  34. // }).toList();
  35. // setState(() {});
  36. // });
  37. super.initState();
  38. }
  39. @override
  40. Widget build(BuildContext context) {
  41. return Scaffold(
  42. appBar: AppBar(
  43. title: Text('测试'),
  44. ),
  45. body: Container(),
  46. // body: CustomScrollView(
  47. // slivers: <Widget>[
  48. // SliverFixedExtentList(
  49. // itemExtent: 200.0,
  50. // delegate: new SliverChildBuilderDelegate(
  51. // (BuildContext context, int index) {
  52. // //创建列表项
  53. // return HomeGoodsItemSingle(
  54. // _goods[index % _goods.length], _styleModel);
  55. // },
  56. // childCount: (_goods?.length ?? 0) * 2000, //50个列表项
  57. // ),
  58. // ),
  59. // // SliverToBoxAdapter(
  60. // // child: ListView.builder(
  61. // // shrinkWrap: true,
  62. // // physics: NeverScrollableScrollPhysics(),
  63. // // itemCount: (_goods?.length ?? 0) * 20,
  64. // // itemBuilder: (context, index) {
  65. // // return HomeGoodsItemSingle(
  66. // // _goods[index % _goods.length], _styleModel);
  67. // // }),
  68. // // )
  69. // ],
  70. // ));
  71. );
  72. }
  73. }