如何获得可扩展的垂直分隔线

时间:2019-08-30 18:29:07

标签: flutter row divider

我正在尝试获取垂直线-ExpansionTile上的分隔线。

我曾尝试将sizeBox或容器添加为开头项,但它并没有扩展,并且空间很大-标题。

Column(

                          children: <Widget>[                   

                            ExpansionTile(
                              leading: new SizedBox(
                                height: 35.0,
                                width: 4.0,
                                child: new Center(
                                  child: new Container(

                                    height: 35.0,
                                    color: Colors.grey,
                                  ),
                                ),
                              ),
                              title: Text('Ordained Presbyter'),
                              children: <Widget>[
                                Column(
                                  children: <Widget>[
                                    Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: <Widget>[                              

                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: <Widget>[
                                            Text(
                                              'Rank Family',
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .title,
                                            ),
                                            Text(
                                              _rankFamily,
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .subtitle,
                                            ),
                                          ],
                                        ),
                                        DropdownButton<String>(
                                          items: _rankFamilyList
                                              .map((String dropDownItem) {
                                            return DropdownMenuItem<String>(
                                              value: dropDownItem,
                                              child: Text(dropDownItem),
                                            );
                                          }).toList(),
                                          onChanged: (String newValue) {
                                            setState(() {
                                              this._rankFamily = newValue;
                                            });
                                          },
                                        ),
                                      ],
                                    ),
                                    Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: <Widget>[
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: <Widget>[
                                            Text(
                                              'Rank',
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .title,
                                            ),
                                            Text(
                                              _rankCoptic,
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .subtitle,
                                            ),
                                          ],
                                        ),
                                        DropdownButtonHideUnderline(
                                          child: DropdownButton<String>(
                                            items: _rankCopticList
                                                .map((String dropDownItem) {
                                              return DropdownMenuItem<String>(
                                                value: dropDownItem,
                                                child: Text(dropDownItem),
                                              );
                                            }).toList(),
                                            onChanged: (String newValue) {

                                              setState(() {
                                                this._rankCoptic = newValue;
                                              });
                                            },
                                          ),
                                        ),
                                      ],
                                    ),
                                    Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: <Widget>[
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: <Widget>[
                                            Text(
                                              'E Rank',
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .title,
                                            ),
                                            Text(
                                              _rankEcclesiastic,
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .subtitle,
                                            ),
                                          ],
                                        ),
                                        DropdownButtonHideUnderline(
                                          child: DropdownButton<String>(
                                            items: _rankEcclesiastList
                                                .map((String dropDownItem) {
                                              return DropdownMenuItem<String>(
                                                value: dropDownItem,
                                                child: Text(dropDownItem),
                                              );
                                            }).toList(),
                                            onChanged: (String newValue) {
                                              setState(() {
                                                this._rankEcclesiastic =
                                                    newValue;
                                              });
                                            },
                                          ),
                                        ),
                                      ],
                                    ),
                                    Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: <Widget>[
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: <Widget>[
                                            Text(
                                              'Ordination Date',
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .title,
                                            ),
                                            Text(
                                              'Sun Nov 24, 2013',
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .subtitle,
                                            ),
                                          ],
                                        ),
                                        IconButton(
                                          icon: Icon(Icons.calendar_today),
                                          onPressed: () {
                                            _selectDate(context);
                                            print('calendar clicked');
                                          },
                                        ),
                                      ],
                                    ),
                                    Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: <Widget>[
                                        Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: <Widget>[
                                            Text(
                                              'Ordained By',
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .title,
                                            ),
                                            Text(
                                              'H.E. Metropolitan Serapion',
                                              textAlign: TextAlign.left,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .subtitle,
                                            ),
                                          ],
                                        ),

                                      ],
                                    ),
                                  ],
                                ),
                              ],
                            ),

                            Divider(
                              height: 1.0,
                              indent: 1.0,

                            ),

                            ExpansionTile(
                              leading: new SizedBox(
                              height: 35.0,
                              width: 4.0,
                              child: new Center(
                                child: new Container(

                                  height: 35.0,
                                  color: Colors.grey,
                                ),
                              ),
                            ),
                              title: Text('Ordained Deacon'),
                              children: <Widget>[
                                Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: <Widget>[
                                    Column(
                                      crossAxisAlignment:
                                          CrossAxisAlignment.start,
                                      children: <Widget>[
                                        Text(
                                          'Rank F1',
                                          textAlign: TextAlign.left,

                                        ),
                                        Text(
                                          'Driver',
                                          textAlign: TextAlign.left,
                                          style: Theme.of(context)
                                              .textTheme
                                              .subtitle,
                                        ),
                                      ],
                                    ),
                                    DropdownButtonHideUnderline(
                                      child: DropdownButton<String>(
                                        items:
                                            _titles.map((String dropDownItem) {
                                          return DropdownMenuItem<String>(
                                            value: dropDownItem,
                                            child: Text(dropDownItem),
                                          );
                                        }).toList(),
                                        onChanged: (String newValue) {

                                        },
                                      ),
                                    ),
                                  ],
                                ),
                              ],
                            ),
    ],
                        ),

因此,我需要可扩展的垂直线,当用户单击ExpansionTile时,该行应与其中的元素一样长。colapsed[![][1]] 2 如果我将容器与ExpansionTile并排放置,我会得到无限的东西...

0 个答案:

没有答案