LoginSignup
0
0

【Flutter】TextFormFieldのキーボードを電話番号用にする

Last updated at Posted at 2024-04-30

こんにちは。
今回は、TextFormFieldのキーボードを電話番号用にする方法を紹介します。

方法

スクリーンショット 2023-08-13 20.18.51.png

TextFormFieldのキーボードを電話番号用にするには、引数の「keyboardType」を使います。
次に、TextFormFieldの引数「keyboardType」に「TextInputType.phone」を指定します。

使用例

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: TextFormField(
        keyboardType: TextInputType.phone,  //ここ!
      ),
    );
  }
}


実行例

keybord.gif

最後に

ここまで読んでいただき、ありがとうございました!
いいねしてくれたら、スキップして喜びます:heartpulse:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0