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.
21 lines
562 B
21 lines
562 B
// 控制器(Logic 层) |
|
import 'package:flutter/material.dart'; |
|
import 'package:get/get.dart'; |
|
import 'package:problem_check_system/modules/problem/problem_page.dart'; |
|
|
|
class HomeController extends GetxController { |
|
// 当前选中索引(状态) |
|
var selectedIndex = 0.obs; |
|
|
|
// 页面列表(View 层) |
|
final List<Widget> pages = [ |
|
Center(child: Text('首页')), |
|
ProblemPage(), |
|
Center(child: Text('我的内容')), |
|
]; |
|
|
|
// 改变选中索引(更新状态) |
|
void changeIndex(int index) { |
|
selectedIndex.value = index; |
|
} |
|
}
|
|
|