代码之家  ›  专栏  ›  技术社区  ›  Nirav Bhavsar

在颤振中调整TextFormField前缀的大小(高度和宽度)不起作用

  •  0
  • Nirav Bhavsar  · 技术社区  · 7 年前
    final password = TextFormField(
      autofocus: false,
      obscureText: true,
      decoration: InputDecoration(
        hintText: 'Password',
        contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
        prefixIcon: new ImageIcon(
          new AssetImage('assets/ic_email.png'),
          size: 15.0,
        ),
      ),
    );
    

    我已将大小设置为15.0,但没有任何更改,因此请指导我,我哪里做错了?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Nirav Bhavsar    7 年前

    刚通过在中设置属性得到了解决方案 影像资产

    final password = TextFormField(
      autofocus: false,
      obscureText: true,
      decoration: InputDecoration(
        hintText: 'Password',
        contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
        prefixIcon: new IconButton(
          icon: new Image.asset('assets/ic_email.png',width: 15.0,height: 15.0,),
          onPressed: null,
        ),
      ),
    );