Sight of Flutter for Web Developers

Sight of Flutter for Web Developers

 

This blog is particularly for the users who are simply familiar with the HTML and CSS syntax for aligning components of an application’s UI. It basically maps HTML/CSS code to their Flutter/Dart code equivalents.

1) Layout operations – There are different following categories to perform the most common UI layout.

• Styling and aligning text- The different attributes of Styling are Font style, size and other text attributes that is handled by CSS with the different font and color properties are particular properties of a Textstyle child of a Text widget.

Sight of flutter for web developers
Sight of flutter for web developers

So now the comparison between the html and flutter is shown by considering the following example :

html: <div class=”greybox”>

Lorem ipsum

</div>

 

.greybox {

background-color: #e0e0e0;

width: 320px;

height: 240px;

font: 900 24px Georgia;

}

Flutter: var container = Container( // grey box

child: Text(

“Lorem ipsum”,

style: TextStyle(

fontSize: 24.0

fontWeight: FontWeight.w900,

fontFamily: “Georgia”,

),),

width: 320.0,

height: 240.0,

color: Colors.grey[300],

);

Setting background color – In Flutter, background of your UI is set using the a Container’s decoration property. Whereas in CSS, hex color is used equivalent to the

Material color palette.

Example is shown below for setting of the background color in html and flutter.

Html: <div class=”greybox”>

Lorem ipsum

</div>

.greybox {

background-color: #e0e0e0;

width: 320px;

height: 240px;

font: 900 24px Roboto;

}

Flutter:  var container = Container( // grey box

child: Text(

“Lorem ipsum”,

style: bold24Roboto,

),

width: 320.0,

height: 240.0,

color: Colors.grey[300],

);

Centering components: A Center widget is basically used to center its child both in a horizontally and vertically manner. Whereas in CSS to attain a similar effect, the parent widget uses either a flex or table-cell to display this behavior.

 Example: The flex behavior example is shown below:

Html: <div class=”greybox”>

Lorem ipsum

</div>

.greybox {

background-color: #e0e0e0; /* grey 300 */

width: 320px;

height: 240px;

font: 900 24px Roboto;

display: flex;

align-items: center;

justify-content: center;

}

Flutter: var container = Container( // grey box

child:  Center(

child:  Text(

“Lorem ipsum”,

style: bold24Roboto,

),

),

width: 320.0,

height: 240.0,

color: Colors.grey[300], );

 

 

 

 

 

 

 

 

112 thoughts on “Sight of Flutter for Web Developers

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Great goods from you, man. I have understand your stuff previous to and you are just too excellent. I actually like what you’ve acquired here, really like what you are stating and the way in which you say it. You make it entertaining and you still take care of to keep it sensible. I cant wait to read much more from you. This is really a great web site.

  2. Can I recently say what relief to get a person that really knows what theyre preaching about on the web. You definitely understand how to bring a problem to light and make it essential. Lots more people really need to see this and understand this side on the story. I cant believe youre no more well-known when you certainly have the gift.

  3. Wonderful goods from you, man. I’ve understand your stuff previous to and you’re just extremely excellent. I actually like what you’ve acquired here, really like what you are stating and the way in which you say it. You make it entertaining and you still take care of to keep it smart. I can not wait to read much more from you. This is really a tremendous web site.

  4. Hmm is anyone else experiencing problems with the images on this blog loading? I’m trying to determine if its a problem on my end or if it’s the blog. Any suggestions would be greatly appreciated.

  5. I like the helpful info you provide in your articles. I will bookmark your blog and check again here frequently. I’m quite sure I will learn plenty of new stuff right here! Good luck for the next!

  6. Very nice post. I just stumbled upon your blog and wanted to say that I have truly enjoyed browsing your blog posts. In any case I will be subscribing to your rss feed and I hope you write again very soon!

  7. I carry on listening to the news bulletin lecture about receiving free online grant applications so I have been looking around for the best site to get one. Could you advise me please, where could i find some?

  8. I just want to tell you that I am just beginner to blogging and definitely liked your page. Probably I’m want to bookmark your site . You actually come with tremendous well written articles. Thank you for revealing your web page.

  9. Its astounding, seeking within the time and work you place into your weblog and detailed specifics you furnish. Ill bookmark your web site and pay a visit to it weekly for the new posts.

  10. Attractive section of content. I just stumbled upon your weblog and in accession capital to assert that I acquire in fact enjoyed account your blog posts. Anyway I will be subscribing to your augment and even I achievement you access consistently rapidly.

  11. I like the valuable info you provide in your articles. I will bookmark your weblog and check again here regularly. I am quite certain I will learn lots of new stuff right here! Best of luck for the next!

  12. Hey very nice web site!! Man .. Excellent .. Amazing .. I will bookmark your web site and take the feeds also…I am happy to find numerous useful information here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .

  13. Hello, Neat post. There is an issue together with your web site in internet explorer, would check this… IE nonetheless is the market chief and a good portion of people will pass over your excellent writing because of this problem.

  14. It’s really a cool and helpful piece of information. I’m glad that
    you shared this useful info with us. Please keep us up to date like this.
    Thank you for sharing.

  15. What i do not realize is in fact how you are now not actually a lot more neatly-favored than you may be now. You’re so intelligent. You understand thus significantly on the subject of this matter, made me in my opinion consider it from numerous numerous angles. Its like women and men aren’t involved until it is one thing to accomplish with Lady gaga! Your own stuffs nice. Always deal with it up!

  16. “Attractive section of content. I just stumbled upon your web site and in accession capital to assert that I acquire in fact enjoyed account your blog posts. Anyway I will be subscribing to your feeds and even I achievement you access consistently fast.”

  17. Hi there, I found your blog by means of Google even as searching for a related topic, your site got here up, it seems great. I have bookmarked it in my google bookmarks.

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.