mobile_skt/lib/screens/landing/landing_controller.dart

24 lines
844 B
Dart

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/services/app_info.service.dart';
class LandingController extends GetxController {
RxInt currentIndex = 0.obs;
List<IconData> iconList = [Icons.home_max, Icons.person_outline_rounded];
RxList bottomNavItems = RxList<BottomNavigationBarItem>([]);
List<Widget> pages = [];
@override
onInit() {
super.onInit();
List<AppBottomNavItem> roleWithBottomNavItems =
AppInfoService.to.bottomNavItems!;
bottomNavItems.assignAll(roleWithBottomNavItems
.map((e) => BottomNavigationBarItem(
icon: e.icon, activeIcon: e.activeIcon, label: e.label))
.toList());
pages = roleWithBottomNavItems.map((e) => e.page!).toList();
}
}