FlutterのSizedBoxを使ってサイズ指定する
最終更新日:2023-10-18
    
    SizedBox
 は、指定したサイズのボックスを作成するためのウィジェットで、子の高さや幅を設定します。余白の作成としても使えます。

SizedBox(
  width: 200,
  height: 100,
  child: ElevatedButton(
    child: const Text('ボタン'),
    onPressed: () {},
  ),
);
    

最終更新日:2023-10-18
    
    SizedBox
 は、指定したサイズのボックスを作成するためのウィジェットで、子の高さや幅を設定します。余白の作成としても使えます。

SizedBox(
  width: 200,
  height: 100,
  child: ElevatedButton(
    child: const Text('ボタン'),
    onPressed: () {},
  ),
);