简体   繁体   中英

how can i make a filled textfield in flutter?

我在https://material.io/design/components/text-fields.html上看到了这个填充的文本字段,但我不知道如何制作?

在此处输入图片说明

Okay, For the first example, you can use the following code snippet:

TextField(
        obscureText: false,
        decoration: InputDecoration(
          border: UnderlineInputBorder(),
          labelText: 'Password',
        ),
      )

And for the second example use snippet is given below:

TextField(
        obscureText: false,
        decoration: InputDecoration(
          border: OutlineInputBorder(),
          labelText: 'Password',
        ),
      )

Hope this helps.

For more details and extended functionalities you can check the docs here: Flutter Docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM