12345678910111213141516171819202122232425262728293031323334 |
- import 'package:flutter/material.dart';
- import 'package:flutter_note/model/category_goods_model.dart';
- /// 分类页面商品列表加载
- class MallGoodsProvide with ChangeNotifier {
- var _page = 1;
- List<CategoryGoodsInfo> _goodsList = [];
- List<CategoryGoodsInfo> get goodList => _goodsList;
- int get page => _page;
- void increasePage() {
- _page++;
- }
- void initialPage() {
- _page = 1;
- }
- // 更换商品大小类别调用
- void changeGoodsList(List<CategoryGoodsInfo> list) {
- _goodsList.clear();
- _goodsList.addAll(list);
- notifyListeners();
- }
- // 上拉加载更多
- void loadMoreGoodsList(List<CategoryGoodsInfo> list) {
- _goodsList.addAll(list);
- notifyListeners();
- }
- }
|