import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
actions: [
Icon(
Icons.menu,
color: Colors.black,
)
],
backgroundColor: Colors.red,
elevation: .0,
),
body: Padding(
padding: EdgeInsets.only(
top: 50.0,
left: 140.0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
FlatButton(
onPressed: () {
print("I am flat");
},
child: Text("OnPressed"),
color: Colors.tealAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0)),
),
SizedBox(
height: 10,
),
FlatButton.icon(
icon: Icon(Icons.settings),
label: Text("Flat icon btn"),
onPressed: () {
print("icon btn");
},
color: Colors.tealAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0)),
),
SizedBox(
height: 10.0,
),
Container(
width: 60,
height: 60,
decoration: BoxDecoration(shape: BoxShape.circle),
child: RaisedButton(
onPressed: () {},
elevation: 12.0,
color: Colors.tealAccent,
child: Icon(Icons.access_alarm_outlined),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(89)),
),
),
SizedBox(
height: 10.0,
),
FlatButton.icon(
onPressed: () {},
icon: Icon(Icons.question_answer),
label: Text("A+B"),
color: Colors.tealAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(13.0),
),
),
SizedBox(
height: 10,
),
InkWell(
onTap: () {
print("Tapped");
},
onDoubleTap: () {
print("double tapped");
},
onLongPress: () {
print("Long Pressed");
},
child: Container(
height: 50,
width: 100,
child: Text("InkWell"),
color: Colors.tealAccent,
),
),
SizedBox(height: 10.0,),
GestureDetector(
onDoubleTap: () => ("Double Tapped"),
onHorizontalDragDown:(values) => print(values),
onVerticalDragEnd:(values1) => print(values1),
child: Container(
height: 50,width: 50,
color: Colors.tealAccent,
child: Text("Gesture"),
),
)
],
),
)),
);
}
}