Flutter ElevatedButtonのパディングを設定する方法
環境
Windows11 pro 64bit
Flutter 3.3.7
概要
ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets(xxx), //パディングを指定
),
),
ElevatedButton.styleFromの引数「padding」に指定したパディングが、
ElevatedButtonのパディングに設定されます。
使用例
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.all(20),
),
onPressed: () {
print("Button Tap Test");
},
child: Text('Button'),
),
),
),
);
}