Added variables to make snackbars possible in the event screen

This commit is contained in:
Mariano Uvalle 2019-04-10 22:34:40 -05:00
parent 86bd438ec8
commit 52623c1511

View file

@ -1,5 +1,3 @@
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../utils.dart' show getImageThumbnailPath; import '../utils.dart' show getImageThumbnailPath;
@ -30,8 +28,20 @@ class EventScreen extends StatefulWidget {
class _EventScreenState extends State<EventScreen> class _EventScreenState extends State<EventScreen>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
/// An instance of the bloc for this screen.
EventBloc bloc; EventBloc bloc;
/// The controller for the tabbed naviagtion.
TabController _tabController; TabController _tabController;
/// The context of the scaffold being shown.
///
/// Needed for showing snackbars.
BuildContext _scaffoldContext;
/// Flag that indicates if there is a snackbar currently being shown.
bool _hasSnackBar = false;
initState() { initState() {
super.initState(); super.initState();
bloc = EventBloc(eventName: widget.eventName); bloc = EventBloc(eventName: widget.eventName);
@ -43,12 +53,17 @@ class _EventScreenState extends State<EventScreen>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: buildAppBar(), appBar: buildAppBar(),
body: TabBarView( body: Builder(
controller: _tabController, builder: (BuildContext context) {
children: <Widget>[ _scaffoldContext = context;
buildTasksListView(), return TabBarView(
buildMediaView(), controller: _tabController,
], children: <Widget>[
buildTasksListView(),
buildMediaView(),
],
);
},
), ),
); );
} }