used various widgets like Container, Column, Card, ListTile, etc to develop a Business card.
safe area: the area other than the place where icons like - signal, wifi, notification, notch, etc live.
use SafeArea
widget
- use
SizedBox()
widget
-
use
crossAxisAlignment.stretch
-
using height/width
height: double.infinity
(for Column Widget)width: double.infinity
(for Row Widget)
CircleAvatar(
radius: 50,
backgroundImage: AssetImage('images/me.png'),
),
Text(
"Rahul Kumar",
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
),
)
-
Download the font and paste inside 'fonts' folder in the app's root directory
-
Uncomment
font area
in pubspec.yaml file and edit family name and other related properties, like this
fonts:
- family: Filxgirl
fonts:
- asset: fonts/Filxgirl.ttf
- Use the font where needed, like this:
style: TextStyle(
fontFamily: 'Filxgirl',
fontSize: 40,
color: Colors.white,
)
- Re-run the app
-
Icon widget
uses a vector graphic, which is a mathematical representation of an image, so it can be rendered more quickly and resized without losing quality. -
Image widget
is rasterized, which means that it is converted to a pixel-based image when it is rendered, so it will become pixelated if it is resized too much -
Icon widget
allows you to change the color, size, and other properties of the icon. The Image widget only allows you to change the size of the image.
- card is like a container widget but it has rounded corners and shadow along with few more properties
- used to give padding to those widgets that don't have padding property like Row(), Column(), Card(), etc
Padding(
padding: EdgeInsets.all(20.0),
child: Row(
children: [
Text("Padding widget example"),
]
)
)
- use ListTile() instead of Row() in Card() widget
ListTile(
leading: Icon(
Icons.phone,
),
title: Text(
'Rahul',
)
)
Run any Flutter repository on Zapp website: refer this link
List of all Flutter apps: click here