Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() => runApp(MaterialApp(
- home: Home(),
- ));
- class Home extends StatefulWidget{
- @override
- _HomeCardState createState() => _HomeCardState();
- }
- class _HomeCardState extends State<Home> {
- int count = 0;
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Colors.grey[900],
- appBar: AppBar(
- title: Text(
- 'Pi ID Card',
- ),
- centerTitle: true,
- backgroundColor: Colors.grey[850],
- elevation: 0.0, // to remove shadow of the appBar
- ),
- floatingActionButton : FloatingActionButton(
- onPressed : (){
- setState((){ // used to change the state of any widget
- count++;
- },);
- },
- child : Icon(
- Icons.add,
- // color : Colors.amberAccent[200],
- ),
- backgroundColor : Colors.grey[800],
- ),
- body: Padding(
- padding: EdgeInsets.fromLTRB(30.0, 40.0, 30.0, 0.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Center(
- child : CircleAvatar(
- backgroundImage : NetworkImage('https://image.flaticon.com/icons/png/512/2726/2726000.png'),
- radius : 40.0,
- backgroundColor : Colors.grey[900],
- ),
- ),
- Divider(
- height : 60.0,
- color : Colors.grey[800],
- ),
- Text(
- 'NAME',
- style: TextStyle(
- color: Colors.grey,
- letterSpacing: 2.0,
- ),
- ),
- //sizedbox => simple alternative for padding between 2 elements(words)
- SizedBox(height: 10.0),
- Text(
- 'Rajath Pai',
- style: TextStyle(
- color: Colors.amberAccent[200],
- letterSpacing: 2.0,
- fontSize: 20.0,
- fontWeight: FontWeight.bold,
- ),
- ),
- SizedBox(height: 30.0),
- Text(
- 'Current Level',
- style: TextStyle(
- color: Colors.grey,
- letterSpacing: 2.0,
- ),
- ),
- //sizedbox => simple alternative for padding between 2 elements(words)
- SizedBox(height: 10.0),
- Text(
- '$count',
- style: TextStyle(
- color: Colors.amberAccent[200],
- letterSpacing: 2.0,
- fontSize: 20.0,
- fontWeight: FontWeight.bold,
- ),
- ),
- SizedBox(height: 30.0),
- Row(
- children : <Widget>[
- Icon(
- Icons.email,
- color : Colors.grey[400],
- ),
- SizedBox(width : 10.0),
- Text(
- 'pai@gmail.com',
- style : TextStyle(
- color : Colors.grey[400],
- fontSize : 18.0,
- letterSpacing : 1.0,
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement