Created
January 18, 2022 16:01
-
-
Save harsh-2024/8b38b3d56b895c99528356e7daef6dac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RoundedButton(Colors.cyan, | |
() => Navigator.pushNamed(context, LoginScreen.id), 'Login'), | |
RoundedButton( | |
Colors.blueAccent, | |
() => Navigator.pushNamed(context, RegistrationScreen.id), | |
'Register') | |
], | |
), | |
), | |
); | |
} | |
} | |
class RoundedButton extends StatelessWidget { | |
RoundedButton(this.colour, @required this.onPressed, this.text); | |
final Color colour; | |
final String text; | |
final Function onPressed; | |
@override | |
Widget build(BuildContext context) { | |
return Padding( | |
padding: EdgeInsets.symmetric(vertical: 16.0), | |
child: Material( | |
elevation: 5.0, | |
color: colour, | |
borderRadius: BorderRadius.circular(30.0), | |
child: MaterialButton( | |
onPressed: () { | |
//Go to login screen. | |
// Navigator.pushNamed(context, LoginScreen.id); | |
onPressed(); | |
}, | |
minWidth: 200.0, | |
height: 42.0, | |
child: Text(text)), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment