carga inicial

This commit is contained in:
2021-05-05 15:52:09 -03:00
parent dbf070041b
commit 129abeccf6
58 changed files with 385 additions and 133 deletions
+46
View File
@@ -0,0 +1,46 @@
import 'package:decpisos/home/home.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:flutter/material.dart';
import 'package:get/get.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(HomeScreen());
this.childrenTabs.add(NotificacoesScreen());
this.tabs.add(TabItem(icon: Icons.video_collection, title: 'Vídeos'));
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');
}
}