2024-03-19 11:09:07 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
2024-04-07 17:32:46 +08:00
|
|
|
import 'package:sk_base_mobile/apis/index.dart';
|
2024-03-26 16:02:49 +08:00
|
|
|
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';
|
2024-04-07 17:32:46 +08:00
|
|
|
import 'package:sk_base_mobile/services/app_info.service.dart';
|
|
|
|
import 'package:sk_base_mobile/util/device.util.dart';
|
|
|
|
import 'package:sk_base_mobile/util/modal.util.dart';
|
|
|
|
|
|
|
|
import '../../constants/constants.dart';
|
2024-03-19 11:09:07 +08:00
|
|
|
|
|
|
|
class LandingController extends GetxController {
|
|
|
|
RxInt currentIndex = 0.obs;
|
2024-03-20 09:37:20 +08:00
|
|
|
RxBool showCreateBtn = true.obs;
|
2024-03-19 11:09:07 +08:00
|
|
|
List<Widget> pages = [];
|
2024-03-26 16:02:49 +08:00
|
|
|
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: '库存',
|
2024-04-07 17:32:46 +08:00
|
|
|
page: const InventoryPage(isPage: true)),
|
2024-03-26 16:02:49 +08:00
|
|
|
AppBottomNavItem(
|
|
|
|
icon: Icons.widgets_outlined,
|
|
|
|
activeIcon: Icons.widgets_rounded,
|
|
|
|
label: '工作台',
|
|
|
|
page: WorkBenchPage()),
|
|
|
|
AppBottomNavItem(
|
|
|
|
icon: Icons.person_outline_outlined,
|
|
|
|
activeIcon: Icons.person,
|
|
|
|
label: '我的',
|
2024-03-31 17:13:29 +08:00
|
|
|
page: const MinePage()),
|
2024-03-26 16:02:49 +08:00
|
|
|
];
|
2024-03-19 11:09:07 +08:00
|
|
|
@override
|
|
|
|
onInit() {
|
|
|
|
super.onInit();
|
2024-03-26 16:02:49 +08:00
|
|
|
pages = bottomNavItems!.map((e) => e.page!).toList();
|
2024-04-07 17:32:46 +08:00
|
|
|
AppInfoService.to.checkVersion();
|
2024-03-19 11:09:07 +08:00
|
|
|
}
|
|
|
|
}
|