flutter 垂直分隔线未显示

问题描述 投票:0回答:1

这是我的代码

Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        title: const Headline2500(text: 'Transaksi'),
        centerTitle: true,
        automaticallyImplyLeading: false,
        elevation: 0,
        toolbarHeight: 50,
      ),
      backgroundColor: Colors.white,
      body: Column(
        children: [
          Container(
            padding: const EdgeInsets.symmetric(horizontal: 16),
            child: Stack(
              children: [
                SvgPicture.asset(
                  'assets/images/transaction/background_transaksi_3.svg',
                  width: MediaQuery.of(context).size.width,
                ),
                const Padding(
                  padding: EdgeInsets.all(16),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      // tagihan
                      Column(
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text(
                            'Tagihan Bulan Ini',
                            style: TextStyle(
                                color: Color(0xff777777), fontSize: 12),
                          ),
                          SizedBox(
                            height: 10,
                          ),
                          Text(
                            'Rp 500.000',
                            style: TextStyle(
                                color: Color(0xff333333),
                                fontSize: 16,
                                fontWeight: FontWeight.bold),
                          )
                        ],
                      ),

                      // divider
                      Padding(
                        padding: EdgeInsets.all(10),
                        child: VerticalDivider(
                          color: Colors.black,
                          thickness: 1,
                          width: 20,
                          indent: 5,
                          endIndent: 5,
                        ),
                      ),

                      // pinjaman
                      Column(
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text('Pinjaman Aktif',
                              style:
                                  TextStyle(color: Colors.grey, fontSize: 12)),
                          SizedBox(
                            height: 10,
                          ),
                          Text('Rp 900.000',
                              style: TextStyle(
                                  color: Colors.black,
                                  fontWeight: FontWeight.bold,
                                  fontSize: 16))
                        ],
                      )
                    ],
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }

任何帮助将不胜感激 我是 flutter 的新手,仍在学习布局,如果用某些小部件包装,看起来某些小部件不会显示..

我是 flutter 的新手,仍在学习布局,如果用某些小部件包装,看起来某些小部件不会显示..

我是 flutter 的新手,仍在学习布局,如果用某些小部件包装,看起来某些小部件不会显示..

flutter divider
1个回答
1
投票

Row
包裹您的
IntrinsicHeight

IntrinsicHeight(
  child: Row(
    children: <Widget>[
      //your children here
    ],
  ),
)
© www.soinside.com 2019 - 2024. All rights reserved.