main.dart
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(primarySwatch: Colors.pink),
home: Scaffold(
appBar: AppBar(
title: const Text("Flutter - Row Background Color")
),
body: bodyContent(),
backgroundColor: Colors.pink.shade50
)
)
);
}
bodyContent(){
return Container(
height: 250,
color: Colors.green.shade200,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(color: Colors.purple.shade200, width: 50),
Container(color: Colors.purple.shade400, width: 50),
Container(color: Colors.purple.shade400, width: 50),
Container(color: Colors.purple.shade800, width: 50)
]
)
);
}
More flutter tutorials
- flutter – Button width match parent
- flutter – How to use SizedBox square
- flutter – Widget minHeight
- flutter – ConstrainedBox maxHeight
- flutter – ConstrainedBox scroll
- flutter – SingleChildScrollView vertical
- flutter – DecoratedBox border
- flutter – BoxDecoration image
- flutter – BoxDecoration opacity
- flutter – BoxDecoration background color
- flutter – How to use FittedBox
- flutter – FittedBox text
- flutter – Row space around
- flutter – Row space evenly
- flutter – Row center vertically