59 lines
2.1 KiB
Dart
59 lines
2.1 KiB
Dart
import 'package:decpisos/home/home.dart';
|
|
//import 'package:decpisos/instagram_embed/instagram_embed.dart';
|
|
import 'package:decpisos/notificacoes/notificacoes.dart';
|
|
//import 'package:decpisos/videos/youtube_videos.dart';
|
|
import 'package:convex_bottom_bar/convex_bottom_bar.dart';
|
|
import 'package:decpisos/pdfviewer/pdfviewer.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:line_icons/line_icons.dart';
|
|
//import 'package:line_icons/line_icons.dart';
|
|
|
|
class IndexController extends GetxController with SingleGetTickerProviderMixin {
|
|
TabController tabController;
|
|
var tabs = List<TabItem>().obs;
|
|
var childrenTabs = List<Widget>().obs;
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
this.initTabs();
|
|
this.tabController.index = 1;
|
|
}
|
|
|
|
@override
|
|
void onClose() {
|
|
this.tabController.dispose();
|
|
super.onClose();
|
|
}
|
|
|
|
void initTabs() {
|
|
//this.childrenTabs.add(YouTubeVideosScreen());
|
|
//this.childrenTabs.add(InstagramScreen());
|
|
this
|
|
.childrenTabs
|
|
.add(Tab(key: PageStorageKey('pdftab'), child: PDFViewerScreen()));
|
|
this.childrenTabs.add(Tab(child: HomeScreen()));
|
|
this.childrenTabs.add(Tab(child: NotificacoesScreen()));
|
|
//this.tabs.add(TabItem(icon: Icons.video_collection, title: 'Vídeos'));
|
|
//this.tabs.add(TabItem(icon: LineIcons.instagram, title: 'Instagram'));
|
|
this
|
|
.tabs
|
|
.add(TabItem(icon: LineIcons.identificationCard, title: 'DecCard'));
|
|
this.tabs.add(TabItem(icon: Icons.home, title: 'Home'));
|
|
this.tabs.add(TabItem(icon: Icons.notifications, title: 'Notificações'));
|
|
this.tabController = TabController(vsync: this, length: this.tabs.length);
|
|
}
|
|
|
|
void tabsWithoutVideos() {
|
|
this.childrenTabs.clear();
|
|
this.tabs.clear();
|
|
this.childrenTabs.add(HomeScreen());
|
|
this.childrenTabs.add(NotificacoesScreen());
|
|
this.tabs.add(TabItem(icon: Icons.home, title: 'Home'));
|
|
this.tabs.add(TabItem(icon: Icons.notifications, title: 'Notificações'));
|
|
this.tabController =
|
|
new TabController(vsync: this, length: this.tabs.length);
|
|
Get.rawSnackbar(message: 'Vídeos temporariamente indisponível');
|
|
}
|
|
}
|