Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class CollegeButton extends StatelessWidget{
  2. final String collegename;
  3. final Widget collegewidget;
  4. final Color color1;
  5. final Color color2;
  6. CollegeButton
  7. ({
  8. this.collegename,
  9. this.collegewidget,
  10. this.color1=Colors.cyanAccent,
  11. this.color2=Colors.yellowAccent
  12. });
  13. @override
  14. Widget build(BuildContext context) {
  15. return Container(padding: EdgeInsets.fromLTRB(0,0,0,0),
  16. decoration: BoxDecoration(color: color1),
  17. width: 90, height: 40,
  18. child: FlatButton(child: Text(collegename,style:TextStyle(color: color2),),
  19. onPressed: ()=>Navigator.push(context, MaterialPageRoute(
  20. builder: (BuildContext context) => collegewidget
  21. )),),
  22. );
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement