Created
December 22, 2022 02:58
-
-
Save josue1dario2/9967635a31021205a9053fce376e4c84 to your computer and use it in GitHub Desktop.
HomeButton
This file contains 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 HomeButton extends StatelessWidget { | |
const HomeButton({Key? key, required this.navigator, required this.icons}) | |
: super(key: key); | |
final Widget navigator; | |
final IconData icons; | |
//Call: | |
//Icon(Icons.sort_by_alpha), | |
//Icons.filter_list | |
@override | |
Widget build(BuildContext context) { | |
final double widthScreem = MediaQuery.of(context).size.width; | |
final double heightScreem = MediaQuery.of(context).size.height; | |
return SizedBox( | |
height: heightScreem * 0.06, | |
width: widthScreem * 0.14, | |
child: ElevatedButton( | |
onPressed: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => navigator), | |
); | |
}, | |
child: Icon( | |
icons, | |
color: const Color(0xFF9356D1), | |
size: 30, | |
), | |
style: ElevatedButton.styleFrom( | |
backgroundColor: const Color(0xFFF6F1FB), | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.circular(20), // <-- Radius | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment