<p>There are a lots of ways to add the asset and network images in flutter. This is one of the simplest way to add images in flutter. First of all,to show the asset image you have to put the image in a folder,in my case i have put the image in image folder.and then you can give the asset path in pubsec.yaml file like this</p> <p>; background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre-wrap;](color: #569cd6;](import color: #ce9178;]('package:flutter/material.dart'; color: #569cd6;](void color: #dcdcaa;](main() => color: #dcdcaa;](runApp(color: #4ec9b0;](MyApp()); color: #569cd6;](class color: #4ec9b0;](MyApp color: #569cd6;](extends color: #4ec9b0;](StatelessWidget { color: #569cd6;](@override color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext context) { color: #c586c0;](return color: #4ec9b0;](MaterialApp( debugShowCheckedModeBanner: color: #569cd6;](false, home: color: #4ec9b0;](HomePage(), ); }} color: #569cd6;](class color: #4ec9b0;](HomePage color: #569cd6;](extends color: #4ec9b0;](StatelessWidget { color: #569cd6;](@override color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext context) { color: #c586c0;](return color: #4ec9b0;](Scaffold( appBar: color: #4ec9b0;](AppBar( title: color: #4ec9b0;](Text(color: #ce9178;]("Image on flutter"), ), backgroundColor: color: #4ec9b0;](Colors.greenAccent, body: color: #4ec9b0;](Center( child: color: #4ec9b0;](Column( children: [ color: #4ec9b0;](Image.color: #dcdcaa;](asset(color: #ce9178;]("image/robo.jpg"), color: #4ec9b0;](Image.color: #dcdcaa;](network( color: #ce9178;]("<a href=>https://picsum.photos/250?image=9</a><a href="https://picsum.photos/250?image=9">https://picsum.photos/250?image=9</a>", ), ], )), ); }}</p>
How to add Assets Images and Network images in flutter?
This Article is posted by bloggeraatit at 9/20/2019 5:54:47 AM
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter
Tags: flutter
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter