Search code examples
fluttercard

Cannot add column inside a card below a row Flutter


I am implementing a card where I have rows, I want to add column below rows inside the card in flutter. I am unable to add column at the bottom inside the card.

Column buildWorkshopSection() {
    return Column(
      children: [
        Card(
          margin: EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0),
          clipBehavior: Clip.antiAlias,
          color: Colors.white,
          elevation: 5.0,
          child: Padding(
            padding:
                const EdgeInsets.symmetric(horizontal: 8.0, vertical: 22.0),
            child: Row(
              children: <Widget>[
                Expanded(
                  child: Column(
                    children: <Widget>[
                      SizedBox(
                        height: 5.0,
                      ),
                      buildStartTimeWorkshop(),
                    ],
                  ),
                ),
                Expanded(
                  child: Column(
                    children: <Widget>[
                      SizedBox(
                        height: 5.0,
                      ),
                      buildCloseTimeWorkshop(),
                    ],
                  ),
                ),
              ],
            ),
          ),
        )
      ],
    );
  }

Solution

  • Add submit button like this

    Card(
                          margin:
                              EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0),
                          clipBehavior: Clip.antiAlias,
                          color: Colors.white,
                          elevation: 5.0,
                          child: Padding(
                            padding: const EdgeInsets.symmetric(
                                horizontal: 8.0, vertical: 22.0),
                            child: Column(
                              children: [
                                Row(
                                  children: <Widget>[
                                    Expanded(
                                      child: Column(
                                        children: <Widget>[
                                          SizedBox(
                                            height: 5.0,
                                          ),
                                          buildStartTimeWorkshop(),
                                        ],
                                      ),
                                    ),
                                    Expanded(
                                      child: Column(
                                        children: <Widget>[
                                          SizedBox(
                                            height: 5.0,
                                          ),
                                          buildCloseTimeWorkshop(),
                                        ],
                                      ),
                                    ),
                                  ],
                                ),
                                SizedBox(
                                  height: 20,
                                ),
                                RaisedButton(
                                  onPressed: () {},
                                  child: Text("Submit"),
                                )
                              ],
                            ),
                          ),
                        ),
    

    It look like this

    enter image description here