class HAButtons extends StatefulWidget {
final childID;
final id;
final buttonTitle;
HAButtons({this.childID,this.id,this.buttonTitle});
@override
_HAButtonsState createState() => _HAButtonsState();
}
class _HAButtonsState extends State<HAButtons>{
@override
Widget build(BuildContext context){
return
RaisedButton(
color: Colors.lightBlue,
onPressed:() =>
_buttonPushed(widget.childID,
widget.id,widget.buttonTitle),
textColor: Colors.white30,
elevation: 5.0,
shape: RoundedRectangleBorder(borderRadius: new BorderRadius.circular(10.0)),
splashColor: Colors.white54,
child:
new Text(widget.buttonTitle,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
),
);
}
_buttonPushed(String parentID, String id, String selectedTitle){
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => ContentPage(parentID:parentID, id: id, selectedTitle: selectedTitle,),
)
);
}
}