Skip to content

Instantly share code, notes, and snippets.

@nanox77
Last active March 14, 2022 13:52
Show Gist options
  • Save nanox77/c02bf24e19edc8ed99ee3eb8eeb51233 to your computer and use it in GitHub Desktop.
Save nanox77/c02bf24e19edc8ed99ee3eb8eeb51233 to your computer and use it in GitHub Desktop.
How to create business card on Flutter
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'MyCard',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyCard(),
);
}
}
class MyCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.teal,
body: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircleAvatar(
radius: 50.0,
backgroundImage: AssetImage('images/mariano.png'),
),
Text(
'Mariano Castellano',
style: TextStyle(
fontFamily: 'Pacifico',
fontSize: 30.0,
color: Colors.white,
),
),
Text(
'FLUTTER DEVELOPER',
style: TextStyle(
fontFamily: 'Source Sans Pro',
fontSize: 20.0,
letterSpacing: 2.5,
color: Colors.teal.shade100,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 20.0,
width: 150.0,
child: Divider(
color: Colors.teal.shade100,
),
),
Card(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0),
child: ListTile(
leading: Icon(
Icons.phone,
color: Colors.teal,
),
title: Text(
'+9 5411 2345 6789',
style: TextStyle(
fontSize: 20.0,
fontFamily: 'Source Sans Pro',
color: Colors.teal.shade900,
),
),
),
),
Card(
color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0),
child: ListTile(
leading: Icon(
Icons.email,
color: Colors.teal,
),
title: Text(
'mariano@email.com',
style: TextStyle(
fontSize: 20.0,
fontFamily: 'Source Sans Pro',
color: Colors.teal.shade900,
),
),
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment