Skip to content

Commit

Permalink
Fixes #37 : Icon change crossFade and some minor patches (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashLadha authored and aashutoshrathi committed Dec 28, 2018
1 parent 36c24b1 commit c474c20
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
24 changes: 19 additions & 5 deletions lib/screens/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,26 @@ class _EventsPageState extends State<EventsPage> {

// Handle Event Card Icon
Widget _eventBtn(Event event) {
bool isRegistered;
if (registeredEvents.containsKey(event.name)) {
if (registeredEvents[event.name])
return Icon(Icons.delete_outline);
isRegistered = true;
else
return Icon(Icons.add_circle_outline);
isRegistered = false;
} else {
return Icon(Icons.add_circle_outline);
isRegistered = false;
}
return AnimatedCrossFade(
firstChild: Icon(
Icons.add_circle_outline,
),
secondChild: Icon(
Icons.delete_outline,
),
crossFadeState:
isRegistered ? CrossFadeState.showSecond : CrossFadeState.showFirst,
duration: Duration(milliseconds: 300),
);
}

Widget _buildListItem(BuildContext context, DocumentSnapshot data) {
Expand Down Expand Up @@ -416,10 +428,12 @@ class _EventsPageState extends State<EventsPage> {
if (_event.date.difference(DateTime.now()).inDays <= 2)
displaySnackBar(
context, "Cannot Unregister from " + _event.name);
else
else {
showUnregisterPrompt(_event, context);
} else
}
} else {
handleEventReg(_event, context);
}
} else {
handleEventReg(_event, context);
}
Expand Down
14 changes: 0 additions & 14 deletions lib/screens/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class _LoginPageState extends State<LoginPage> {
}
}

Future<void> _handleSignOut() async {
AuthManager().signOut();
}

@override
Widget build(BuildContext context) {
return Stack(
Expand Down Expand Up @@ -50,16 +46,6 @@ class _LoginPageState extends State<LoginPage> {
child: Text('Login with Google'),
onPressed: () => _handleSignIn(),
),
SizedBox(
height: 10.0,
),
OutlineButton(
borderSide: BorderSide(color: Colors.deepOrange),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0)),
child: Text('Logout'),
onPressed: () => _handleSignOut(),
),
],
),
)
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/splash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _SplashState extends State<Splash> {
@override
Widget build(BuildContext context) {
return new SplashScreen(
seconds: 7,
seconds: 4,
navigateAfterSeconds: _routingWidget,
title: Text(
'Just wait a little longer...',
Expand Down

0 comments on commit c474c20

Please sign in to comment.