I have created a round button with the letter 'M'. Once this button is tapped I want to display text to the right of it. Initially there should be no text to the right of the button and only displayed once the button is tapped.
I have been able to get a message to print in onPressed but I'm confused as to why I can't get anything to display to the side of the button.
How would I get this to work?
}
class _SelectDaysState extends State<SelectDays> {
bool selectedDay = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
gradient: LinearGradient(colors: [
Theme.of(context).colorScheme.charcoalGrey,
Theme.of(context).colorScheme.black
], begin: Alignment.topCenter, end: Alignment.bottomCenter),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 60),
Padding(
padding: const EdgeInsets.only(left: 20, bottom: 70),
child: Text(
'Select your days!',
style: h1,
),
),
Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 20),
),
Column(
children: <Widget>[
Row(
children: <Widget>[
Container(
child: SizedBox.fromSize(
size: Size(56, 56),
child: ClipOval(
child: Material(
color: Theme.of(context).colorScheme.watermelon,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
child: Text('Selected',
style: TextStyle(
color: Colors.white),
),
onPressed: () {
setState(() {
selectedDay = true;
});
Column(
children: <Widget>[
Row(
children: <Widget>[
Container(
child: SizedBox.fromSize(
size: Size(56, 56),
child: ClipOval(
child: Material(
color: Theme.of(context).colorScheme.watermelon,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Text('M', style: h2),
onPressed: () {
SizedBox(width: 40,);
Visibility(child: Text("Gone",
style: TextStyle(color: Colors.white),
),
visible: true,
);