Skip to content

Instantly share code, notes, and snippets.

View khoasvn's full-sized avatar
🏠
Working from home

Khoa Vo khoasvn

🏠
Working from home
  • Saber
  • Ho Chi Minh City
View GitHub Profile
class _HomeScreenState extends State<HomeScreen> {
Widget _appBar;
Widget _appBody;
MenuBloc _menuBloc;
List<TabItem> _tabItems = [
TabItem(icon: Icons.contacts, title: 'Contacts'),
TabItem(icon: Icons.rate_review, title: 'Review'),
TabItem(icon: Icons.message, title: 'Contracts'),
TabItem(icon: Icons.person, title: 'Profile'),
Widget submitButton() {
return RaisedButton(
child: Text('Submit'),
onPressed: () {
_menuBloc.add(GoToContacts());
},
);
}
class MenuBloc extends Bloc<MenuEvent, MenuState> {
MenuBloc() : super(MenuContacts());
//static var bottomNav = GlobalKey<ConvexAppBarState>();
final bottomNav = CBKey.bottomNav;
@override
Stream<MenuState> mapEventToState(MenuEvent event) async* {
if (event is GoToContacts) {
yield* _mapMenuGoToContacts();