import 'package:flutter/material.
dart';
void main() => runApp(MaterialApp(
//base layout
home: Home()));
//stless shortcut to create a class
// how to stop connection auto terminated
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
//convention of widget name
appBar: AppBar(
title: Text(
'My first app',
style: TextStyle(
fontSize: 40.0,
fontWeight: FontWeight.bold,
color: Colors.grey[600],
fontFamily: 'Poppins',
fontStyle: FontStyle.normal,
),
),
backgroundColor: Colors.pinkAccent[200],
centerTitle: true,
),
body: Center(
// properties nested inside
child: IconButton(
onPressed: () => print('Click me'),
iconSize: 50,
color: Colors.green[400],
icon: Icon(Icons.mail),
style: IconButton.styleFrom(
backgroundColor: Colors.green[700],
),
)
), // image: AssetImage('assets/OIP.jpg'),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Text('click'),
)
);
}
}
// breakpoint is what the heck in debugging