import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: ListCart(),
),
);
}
class ListCart extends StatefulWidget {
@override
_ListCartState createState() => _ListCartState();
}
class _ListCartState extends State<ListCart> {
int idNumber = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[500],
appBar: AppBar(
title: Text("Title Bar"),
backgroundColor: Colors.green[850],
centerTitle: true,
elevation: 25.0,
),
floatingActionButton: FloatingActionButton(
onPressed: () {
setState(() {
idNumber += 1;
});
},
child: Icon(Icons.add),
),
body: Padding(
padding: const EdgeInsets.fromLTRB(30.0, 40.0, 30.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: CircleAvatar(
backgroundImage: NetworkImage(
"https://images.unsplash.com/photo-1592854899481-f78db4baccb6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1534&q=80"),
radius: 40.0,
),
),
Divider(
height: 50.0,
color: Colors.grey[800],
),
SizedBox(
height: 10.0,
),
Text(
"Name:",
style: TextStyle(
color: Colors.red,
),
),
Text(
"Ram Pukar",
style: TextStyle(
color: Colors.yellow,
fontSize: 20.0,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 10.0,
),
Text(
"Name:",
style: TextStyle(
color: Colors.red,
),
),
Text(
"Mohan Kumar",
style: TextStyle(
color: Colors.yellow,
fontSize: 20.0,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 30.0,
),
Text(
"ID Number:",
style: TextStyle(
color: Colors.red,
),
),
Text(
"$idNumber",
style: TextStyle(
color: Colors.yellow,
fontSize: 20.0,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 30.0,
),
Row(
children: [
Icon(
Icons.mail,
color: Colors.grey[400],
),
SizedBox(
width: 10.0,
),
Text("rampukar@gmail.com")
],
),
],
),
),
);
}
}
Output:
0 comments:
Post a Comment