Created
January 5, 2023 03:54
-
-
Save josue1dario2/c99c8f2eb8ab3b4b947610a363321ca6 to your computer and use it in GitHub Desktop.
2.Add Button
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
class ButtonAdd extends StatelessWidget { | |
const ButtonAdd({Key? key, required this.navigator, required this.text}) | |
: super(key: key); | |
final Widget navigator; | |
final String text; | |
@override | |
Widget build(BuildContext context) { | |
Size size = MediaQuery.of(context).size; | |
return MaterialButton( | |
elevation: 0, | |
onPressed: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => navigator), | |
); | |
}, | |
child: Container( | |
decoration: BoxDecoration( | |
color: Colors.white, | |
borderRadius: BorderRadius.circular(40.0), | |
border: Border.all(color: const Color(0xFF482F74), width: 1.5), | |
), | |
height: size.height * 0.062, | |
width: size.width * 0.85, | |
child: Center( | |
child: CustomText( | |
text: text, | |
size: 14, | |
weight: FontWeight.w600, | |
color: const Color(0xFF482F74))), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment