mobile_skt/lib/screens/landing/landing_controller.dart

43 lines
1.4 KiB
Dart
Raw Permalink Normal View History

2024-10-16 09:48:17 +08:00
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/models/app_bottom_nav_item.dart';
import 'package:sk_base_mobile/screens/inventory/inventory.dart';
import 'package:sk_base_mobile/screens/inventory_inout/inventory_inout.dart';
import 'package:sk_base_mobile/screens/mine/mine.dart';
import 'package:sk_base_mobile/screens/workbench/workbench.dart';
import 'package:sk_base_mobile/services/app_info.service.dart';
class LandingController extends GetxController {
RxInt currentIndex = 0.obs;
RxBool showCreateBtn = true.obs;
List<Widget> pages = [];
List<AppBottomNavItem>? bottomNavItems = [
AppBottomNavItem(
icon: Icons.home_max_outlined,
activeIcon: Icons.home_max_outlined,
label: '登记',
page: InvenotryInoutPage()),
AppBottomNavItem(
icon: Icons.inventory_outlined,
activeIcon: Icons.inventory_rounded,
label: '库存',
page: const InventoryPage(isPage: true)),
AppBottomNavItem(
icon: Icons.widgets_outlined,
activeIcon: Icons.widgets_rounded,
label: '工作台',
page: WorkBenchPage()),
AppBottomNavItem(
icon: Icons.person_outline_outlined,
activeIcon: Icons.person,
label: '我的',
page: const MinePage()),
];
@override
onInit() {
super.onInit();
pages = bottomNavItems!.map((e) => e.page!).toList();
AppInfoService.to.checkVersion();
}
}