feat: 首页单列模式

This commit is contained in:
guozhigq
2023-08-27 11:51:36 +08:00
parent 1d0b91f80b
commit b9e78bf2ec
10 changed files with 250 additions and 208 deletions

View File

@ -1,17 +1,27 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hive/hive.dart';
import 'package:pilipala/http/live.dart';
import 'package:pilipala/models/live/item.dart';
import 'package:pilipala/utils/storage.dart';
class LiveController extends GetxController {
final ScrollController scrollController = ScrollController();
int count = 12;
int _currentPage = 1;
int crossAxisCount = 2;
RxInt crossAxisCount = 2.obs;
RxList<LiveItemModel> liveList = [LiveItemModel()].obs;
bool isLoadingMore = false;
bool flag = false;
OverlayEntry? popupDialog;
Box setting = GStrorage.setting;
@override
void onInit() {
super.onInit();
crossAxisCount.value =
setting.get(SettingBoxKey.enableSingleRow, defaultValue: false) ? 1 : 2;
}
// 获取推荐
Future queryLiveList(type) async {