Sight of Flutter for Web Developers- Part 2

Sight of Flutter for Web Developers- Part 2

Manipulating position and size-
To perform more complex operation on the widgets like position, size and background, the following categories are defined .
• Setting absolute position – As we all know by default every child widget is positioned relative to their parent widget. But to specify an absolute position for any of the widget on x axis oy y axis you will have to positioned that widget and then nest in a stack widget.

Flutter

Example below is shown in both html/CSS and flutter:
html:

Lorem ipsum

.greybox {
background-color: #e0e0e0;
width: 320px;
height: 240px;
font: 900 24px Roboto;
position: relative;
}
.redbox {
background-color: #ef5350;
padding: 16px;
color: #ffffff;
position: absolute;
top: 24px;
left: 24px;
}
Flutter: var container = Container( // grey box
child: Stack(
children: [
Positioned( // red box
child: Container(
child: Text(
“Lorem ipsum”,
style: bold24Roboto,),
decoration: BoxDecoration(
color: Colors.red[400],),
padding: EdgeInsets.all(16.0),),
left: 24.0,
top: 24.0,
),],),
width: 320.0,
height: 240.0,
color: Colors.grey[300],);
• Rotating components- If you want to rotate your widget then you will have to nest it in a Transform widget. For that you will have to use the transform widgt’s alignment and ofcourse its origin properties to define the transform origin in the relative and absolute words respectively. In a 2D rotation the widget can be rotated on the Z axis using radians i.e degrees * 3.14/180.
Example below is shown for rotating components in both html/CSS and flutter:
html:

Lorem ipsum

.greybox {
background-color: #e0e0e0; /* grey 300 */
width: 320px;
height: 240px;
font: 900 24px Roboto;
display: flex;
align-items: center;
justify-content: center;
}
.redbox {
background-color: #ef5350; /* red 400 */
padding: 16px;
color: #ffffff;
transform: rotate(15deg);
}
Flutter: var container = Container( // gray box
child: Center(
child: Transform(
child: Container( // red box
child: Text(
“Lorem ipsum”,
style: bold24Roboto,
textAlign: TextAlign.center,
),
decoration: BoxDecoration(
color: Colors.red[400],
),
padding: EdgeInsets.all(16.0),
),
alignment: Alignment.center,
transform: Matrix4.identity()
..rotateZ(15 * 3.1415927 / 180),
),
),
width: 320.0,
height: 240.0,
color: Colors.grey[300],
);

42 thoughts on “Sight of Flutter for Web Developers- Part 2

Leave a Reply

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

  1. Hello, i think that i noticed you visited my website thus i came to “return the desire”.I’m trying to to find things to improve my web site!I guess its adequate to make use of some of your concepts!!

  2. What i do not understood is actually how you’re not really much more well-liked than you may be now. You’re very intelligent. You realize therefore significantly relating to this subject, produced me personally consider it from numerous varied angles. Its like women and men aren’t fascinated unless it’s one thing to accomplish with Lady gaga! Your own stuffs outstanding. Always maintain it up!

  3. It is perfect time to make some plans for the future and it is time to be happy. I have read this post and if I could I want to suggest you some interesting things or suggestions. Maybe you can write next articles referring to this article. I desire to read more things about it!

  4. Very nice post. I just stumbled upon your blog and wanted to say that I have truly enjoyed surfing around your blog posts. In any case I’ll be subscribing to your rss feed and I hope you write again soon!

  5. Thank you a lot for sharing this with all of us you actually understand what you’re speaking about! Bookmarked. Please additionally talk over with my site =). We will have a link trade arrangement between us!

  6. I¡¦ll immediately grab your rss feed as I can not in finding your email subscription link or newsletter service. Do you’ve any? Kindly permit me recognise in order that I may subscribe. Thanks.

  7. It is perfect time to make some plans for the future and it’s time to be happy. I have read this post and if I could I want to suggest you few interesting things or advice. Maybe you can write next articles referring to this article. I desire to read more things about it!

  8. I would like to express some appreciation to the writer for rescuing me from this particular problem. After looking out throughout the the web and seeing basics which are not pleasant, I figured my life was well over. Living without the solutions to the difficulties you have resolved by way of this report is a crucial case, as well as those that could have badly damaged my career if I had not discovered the website. Your actual knowledge and kindness in handling all the details was invaluable. I’m not sure what I would have done if I hadn’t come across such a subject like this. I am able to at this time look forward to my future. Thanks for your time so much for your professional and sensible help. I will not hesitate to propose your web page to any individual who ought to have support about this area.

  9. You really make it seem so easy with your presentation but I find this matter to be actually something that I think I would never understand. It seems too complex and extremely broad for me. I am looking forward for your next post, I’ll try to get the hang of it!

  10. What’s Taking place i’m new to this, I stumbled upon this I have found It positively useful and it has helped me out loads. I’m hoping to give a contribution & help different users like its aided me. Great job.

  11. magnificent post, very informative. I wonder why the other experts of this sector do not notice this. You should continue your writing. I am confident, you’ve a great readers’ base already!

  12. Do you have a spam problem on this website; I also am a blogger, and I was wanting to know your situation; we have created some nice procedures and we are looking to swap solutions with other folks, why not shoot me an e-mail if interested.

  13. Hey there! This is kind of off topic but I need some help from an established blog. Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about setting up my own but I’m not sure where to begin. Do you have any points or suggestions? With thanks

  14. Just want to say your article is as astonishing. The clearness in your post is simply excellent and i can think you’re a professional on this subject. Well together with your permission allow me to take hold of your RSS feed to stay updated with impending post. Thanks a million and please keep up the gratifying work.

  15. I know this if off topic but I’m looking into starting my own weblog and was wondering what all is needed to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very web savvy so I’m not 100 sure. Any suggestions or advice would be greatly appreciated. Thanks

  16. My developer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the costs. But he’s tryiong none the less. I’ve been using WordPress on numerous websites for about a year and am concerned about switching to another platform. I have heard excellent things about blogengine.net. Is there a way I can import all my wordpress posts into it? Any help would be greatly appreciated!

  17. You’ve made some decent points there. I checked on the net for additional
    information about the issue and found most individuals will go along with your views on this web site.

  18. hello there and thank you for your information – I have definitely picked up something new from right here. I did however expertise several technical points using this site, as I experienced to reload the site many times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and can damage your high quality score if ads and marketing with Adwords. Anyway I’m adding this RSS to my email and could look out for much more of your respective exciting content. Make sure you update this again soon.

  19. Interesting blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog stand out. Please let me know where you got your design. Thank you

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.