import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
home: Home(),
),
);
}
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey,
appBar: AppBar(
leading: IconButton(
onPressed: () {}, icon: const Icon(Icons.add_task_outlined)),
title: const Text("Flutter: Primeiros Passos"),
),
body: ListView(
children: [
const Cores(Colors.white, Colors.pink, Colors.lightBlueAccent),
const Cores(Colors.red, Colors.purple, Colors.blueAccent),
Cores(Colors.pinkAccent, Colors.orange, Colors.lightBlue.shade400),
const Cores(Colors.purpleAccent, Colors.white, Colors.green),
],
),
);
}
}
class Cores extends StatelessWidget {
final Color color1;
final Color color2;
final Color color3;
const Cores(this.color1, this.color2, this.color3, {Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: [
Container(
color: color1,
width: 110,
height: 140,
),
Container(
color: color2,
width: 110,
height: 140,
),
Container(
color: color3,
width: 110,
height: 140,
),
],
),
),
],
);
}
}