76 lines
1.9 KiB
Dart
76 lines
1.9 KiB
Dart
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:pj_supermarket_cloud/common/index.dart';
|
|
|
|
class VersionManageController extends GetxController {
|
|
static const String _tag = "版本管理 Controller";
|
|
|
|
final appC = Get.find<AppControl>();
|
|
|
|
RxInt currentPage = RxInt(1);
|
|
|
|
RxInt totalPage = RxInt(0);
|
|
|
|
RxInt pageSize = RxInt(15);
|
|
|
|
/// 搜索
|
|
Future<void> doPage({int? page}) async {
|
|
if (page != null) currentPage.value = page;
|
|
await getVersionList(isLoading: true);
|
|
}
|
|
|
|
/// 获取版本列表
|
|
Future<void> getVersionList({bool isLoading = false}) async {
|
|
if (isLoading) {
|
|
EasyLoading.show(
|
|
status: '查询中...',
|
|
maskType: EasyLoadingMaskType.black,
|
|
);
|
|
}
|
|
try {} finally {
|
|
if (isLoading) {
|
|
Future.delayed(const Duration(seconds: 1), () {
|
|
EasyLoading.dismiss();
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Widget settingVersionSetting(BuildContext context) {
|
|
final versionC = Get.put<VersionManageController>(
|
|
VersionManageController(),
|
|
);
|
|
return <Widget>[
|
|
buildSettingVersionSettingSearch(context),
|
|
buildSettingVersionSettingList(context).expanded(),
|
|
Obx(
|
|
() => appPage(
|
|
context,
|
|
pageNo: versionC.currentPage.value,
|
|
pageSize: versionC.pageSize.value,
|
|
total: versionC.totalPage.value,
|
|
onPageChanged: (pageNo) => versionC.doPage(page: pageNo),
|
|
),
|
|
)
|
|
].toColumn();
|
|
}
|
|
|
|
// 版本更新搜索区域
|
|
Widget buildSettingVersionSettingSearch(BuildContext context) {
|
|
return Container();
|
|
}
|
|
|
|
// 版本更新列表区域
|
|
Widget buildSettingVersionSettingList(BuildContext context) {
|
|
return Container();
|
|
}
|
|
|
|
// 版本管理卡片
|
|
Widget buildSettingVersionSettingCard(BuildContext context) {
|
|
return Container();
|
|
}
|