|
|
|
|
@ -38,7 +38,7 @@ class ProblemListPage extends GetView<ProblemListController> {
|
|
|
|
|
const Divider(height: 1, thickness: 1), |
|
|
|
|
|
|
|
|
|
// 列表区域总是显示 |
|
|
|
|
Expanded(child: _buildEnterpriseList()), |
|
|
|
|
Expanded(child: _buildProblemListList()), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
@ -272,18 +272,18 @@ class ProblemListPage extends GetView<ProblemListController> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// 构建问题列表 |
|
|
|
|
Widget _buildEnterpriseList() { |
|
|
|
|
Widget _buildProblemListList() { |
|
|
|
|
// 使用下拉刷新包裹列表 |
|
|
|
|
return RefreshIndicator( |
|
|
|
|
onRefresh: () async => controller.loadAndSyncProblems(), |
|
|
|
|
child: Obx(() { |
|
|
|
|
// 3. 在加载中状态,直接显示加载动画(此时不可滚动是合理的) |
|
|
|
|
if (controller.isLoading.value && controller.enterpriseList.isEmpty) { |
|
|
|
|
if (controller.isLoading.value && controller.problemList.isEmpty) { |
|
|
|
|
return const Center(child: CircularProgressIndicator()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 4. 当列表为空时,将空状态提示也放入一个 ListView 中 |
|
|
|
|
if (controller.enterpriseList.isEmpty) { |
|
|
|
|
if (controller.problemList.isEmpty) { |
|
|
|
|
// 使用 ListView 包裹,并设置 AlwaysScrollableScrollPhysics |
|
|
|
|
return ListView( |
|
|
|
|
// [!!!] 关键:这行代码让 ListView 即使在内容不足一屏时也能滚动 |
|
|
|
|
|