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.

38 lines
1.2 KiB

import 'package:flutter/material.dart';
import 'package:get/get.dart';
2 weeks ago
import 'package:problem_check_system/modules/home/controllers/home_controller.dart';
class HomePage extends GetView<HomeController> {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Obx(
() => Scaffold(
body: controller.pages[controller.selectedIndex.value], // 根据状态显示页面
bottomNavigationBar: NavigationBar(
selectedIndex: controller.selectedIndex.value,
onDestinationSelected: controller.changeIndex, // 回调控制状态更新
destinations: const [
// NavigationDestination(
// icon: Icon(Icons.home_outlined),
// selectedIcon: Icon(Icons.home),
// label: '首页',
// ),
NavigationDestination(
icon: Icon(Icons.description_outlined),
selectedIcon: Icon(Icons.description),
label: '问题',
),
NavigationDestination(
icon: Icon(Icons.person_outline),
selectedIcon: Icon(Icons.person),
label: '我的',
),
],
),
),
);
}
}