0% found this document useful (0 votes)
47 views6 pages

MAD PR 4exp

Flutter provides widgets for including icons and images in apps. The Icon widget displays icons using properties like icon, color, and size. Flutter icons come from the Icons class. Images can be added using the Image widget, which supports formats like JPEG, PNG, and GIF. Code examples demonstrate using Icon widgets to display app icons and the Image widget to display a remote image by URL.

Uploaded by

Smaranika Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views6 pages

MAD PR 4exp

Flutter provides widgets for including icons and images in apps. The Icon widget displays icons using properties like icon, color, and size. Flutter icons come from the Icons class. Images can be added using the Image widget, which supports formats like JPEG, PNG, and GIF. Code examples demonstrate using Icon widgets to display app icons and the Image widget to display a remote image by URL.

Uploaded by

Smaranika Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Experiment No:-04

Aim:- To include icons, images, charts in flutter app


Theory:-

Flutter Icons
An icon is a graphic image representing an application or any specific entity containing
meaning for the user. It can be selectable and non-selectable. For example, the company's logo
is non-selectable. Sometimes it also contains a hyperlink to go to another page. It also acts as a
sign in place of a detailed explanation of the actual entity.
Flutter provides an Icon Widget to create icons in our applications. We can create icons in
Flutter, either using inbuilt icons or with the custom icons. Flutter provides the list of all icons
in the Icons class. In this article, we are going to learn how to use Flutter icons in the
application.
Icon Widget Properties
Flutter icons widget has different properties for customizing the icons. These properties are
explained below:

Property Descriptions
icon It is used to specify the icon name to display in the application. Generally,
Flutter uses material design icons that are symbols for common actions
and items.
color It is used to specify the color of the icon.
size It is used to specify the size of the icon in pixels. Usually, icons have
equal height and width.
textDirection It is used to specify to which direction the icon will be rendered.

Flutter images
When you create an app in Flutter, it includes both code and assets (resources). An asset is a
file, which is bundled and deployed with the app and is accessible at runtime. The asset can
include static data, configuration files, icons, and images. The Flutter supports many image
formats, such as JPEG, WebP, PNG, GIF, animated WebP/GIF, BMP, and WBMP.Displaying
images is the fundamental concept of most of the mobile apps. Flutter has an Image widget
that allows displaying different types of images in the mobile application.

Code:- For icons

import 'package:flutter/material.dar:
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyIconPage(),
);
}
}
class MyIconPage extends StatefulWidget {
@override
_MyIconPageState createState() => _MyIconPageState();
}
class _MyIconPageState extends State<MyIconPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter Icon Tutorial'),
),
body: Column(children: <Widget>[
//icon with label below it
Container(
padding: EdgeInsets.all(30),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Column(children: <Widget>[
Icon(
Icons.camera_front,
size: 70
),
Text('Front Camera'),
]),
Column(children: <Widget>[
Icon(
Icons.camera_enhance,
size: 70
),
Text('Camera'),
]),
Column(children: <Widget>[
Icon(
Icons.camera_rear,
size: 70
),
Text('Rear Camera'),
]),
]
),
)
],
)
);
}
}

Output:-

Code:- For images

import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Flutter Image Demo'),
),
body: Center(
child: Column(
children: <Widget>[
Image.network(
'https://static.javatpoint.com/tutorial/flutter/images/flutter-creating-android-
platform-specific-code3.png',
height: 400,
width: 250),
Text(
'It is an image displays from the given url.',
style: TextStyle(fontSize: 20.0),
)
],
),
),
),
);
}
}

Output
Conclusion:-

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy