Apply Margin To Image Widget
Complete Code For Apply Margin To Image Widget In Flutter
Main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
backgroundColor: Color(0xFF4527A0),
title: Text('Apply Margin To Image Widget'),
),
body: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
margin: const EdgeInsets.fromLTRB(15, 0, 15, 20),
child:
Image.asset('assets/img1.jpg',
width: 130, height: 200, fit: BoxFit.contain,)
),
Container(
margin: const EdgeInsets.fromLTRB(15, 0, 15, 20),
child:
Image.asset('assets/img2.jpg',
width: 130, height: 200, fit: BoxFit.contain,)
),
],
),
)));
}
}