How to Show Border Around Image in Flutter

This Article is posted by xitex34014 at 5/8/2021 8:33:44 AM



<p>box-sizing: inherit; border: 0px; font-size: 15px; margin-right: 0px; margin-bottom: 1.6em; margin-left: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(58, 58, 58); font-family: -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255);](I have already blogged on</p> <h2 id="entry-titleitempropheadlineborder-0px-margin-right-0px-margin-bottom-0px-margin-left-0px-padding-0px-font-family-apple-system-system-ui-system-ui-segoe-ui-helvetica-arial-sans-serif-apple-color-emoji-segoe-ui-emoji-segoe-ui-symbol-font-size-30px-font-weight-700-line-height-1.2em-color-rgb58-58-58-background-color-rgb255-255-255">entry-titleitemprop="headlineborder: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding: 0px; font-family: -apple-system, system-ui, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 30px; font-weight: 700; line-height: 1.2em; color: rgb(58, 58, 58); background-color: rgb(255, 255, 255);](</h2> <p>[https://fluttercorner.com/how-to-add-borders-to-a-widget-in-flutter/rel="bookmarkborder: 0px; margin: 0px; padding: 0px; transition: color 0.1s ease-in-out 0s, background-color 0.1s ease-in-out 0s; color: rgb(30, 115, 190);](How to Add Borders to a Widget In Flutter ?)</p> <p>box-sizing: inherit; border: 0px; font-size: 15px; margin-right: 0px; margin-bottom: 1.6em; margin-left: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(58, 58, 58); font-family: -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255);]( and runApp(MyApp());</p> <p>class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Welcome to Flutter', home: Scaffold( appBar: AppBar( title: Text('Flutter Image with border Example'), ), body: Center( child: Body() ), ), ); } }</p> <p>/// This is the stateless widget that the main application instantiates. class Body extends StatelessWidget { @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( color: const Color(0xff7c94b6), image: DecorationImage( image: ExactAssetImage('images/girl.png'), fit: BoxFit.cover, ), border: Border.all( color: Colors.red, width: 10.0, ), ), ); } } `</p>


Tags: flutter








1 Comments
Login to comment.
Recent Comments

seven.srikanth at 5/31/2021

nice one.

Login to Reply.