「Flutter/UI/Scaffold」の版間の差分
ナビゲーションに移動
検索に移動
ページの作成:「==上部バーの右にボタンを設置== <pre> @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("$wid...」 |
細 Admin がページ「Flutter/UI/上部Button」を「Flutter/UI/Scaffold」に移動しました |
(相違点なし)
| |
2019年11月16日 (土) 08:23時点における版
上部バーの右にボタンを設置
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("$widget.title"),
actions: _buildAppBarActionButton()
),
);
}
List<Widget> _buildAppBarActionButton() {
return <Widget>[
MaterialButton(
onPressed: () {
},
child: Text(
"Setting",
style: TextStyle(
fontSize: 14.0,
color: Colors.white
),
),
)
];
}
iconを右上に設定したい場合
flutter/アイコン追加 [ショートカット]
List<Widget> _buildAppBarActionButton() {
return <Widget>[
MaterialButton(
onPressed: () {
},
child: Icon(
Icons.settings,
color: Colors.white,
size: 30.0,
)
)
];
}