//flutter
import 'package:flutter/material.dart';
void main() {
return runApp(TestPage());
}
//リスト4.8
class TestPage extends StatelessWidget{
@override
Widget build(BuildContext context){
return MaterialApp(
title: 'ボタン',
home: Scaffold(
appBar: AppBar(title:Text('ボタン')),
body: Center(
child: Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
ElevatedButton(onPressed: (){},
style:ElevatedButton.styleFrom(
side:BorderSide(
color: Colors.grey,
width: 2,
),
onPrimary: Colors.black,
),
child: Text('ElevatedButton',
style: TextStyle(
color: Colors.white,
))),
IconButton(onPressed: (){}, icon: Icon(Icons.flutter_dash)),
OutlinedButton(onPressed: (){}, child: Text('OutlinedButton')),
TextButton(onPressed: (){}, child: Text("TextButton"))
])),
floatingActionButton: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 16.0),
child: FloatingActionButton(
onPressed: () {},
backgroundColor: Colors.grey,
child: const Icon(Icons.arrow_back),
)),
FloatingActionButton(
onPressed: () {},
backgroundColor: Colors.blueGrey,
child: const Icon(Icons.arrow_forward),
)
],
)
),
);
}
}