From 75982102d8bdfed14680fbebe52c72b22b7fb85d Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Fri, 8 Mar 2019 22:39:16 -0600 Subject: [PATCH] Changed the callback in loginscreen to be an arrow function, added docs for the attributes in gradient button --- lib/src/screens/login_screen.dart | 2 +- lib/src/widgets/gradient_button.dart | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/src/screens/login_screen.dart b/lib/src/screens/login_screen.dart index 0b2ca41..d51f9b1 100644 --- a/lib/src/screens/login_screen.dart +++ b/lib/src/screens/login_screen.dart @@ -23,7 +23,7 @@ class LoginScreen extends StatelessWidget { Expanded( child: Center( child: GradientButton( - onTap: _authService.googleLoginAndSignup(), + onTap: () => _authService.googleLoginAndSignup(), height: 50, width: 310, radius: 25, diff --git a/lib/src/widgets/gradient_button.dart b/lib/src/widgets/gradient_button.dart index c5799a3..4f9f528 100644 --- a/lib/src/widgets/gradient_button.dart +++ b/lib/src/widgets/gradient_button.dart @@ -1,13 +1,21 @@ -import 'dart:math'; - import 'package:flutter/material.dart'; class GradientButton extends StatelessWidget { + /// The border radius of the button. final double radius; + + /// The Widget to be contained inside the button. final Widget child; + + /// Height of the button. final double height; + + /// Width of the button. final double width; - final onTap; + + /// Function to be called when the button is pressed. + final VoidCallback onTap; + GradientButton({ this.radius = 4, @required this.child,