import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text('Flutter: Primeiros Passos'),
),
body: ListView(
children: const [
Padding(padding: EdgeInsets.only(top: 8),),
Cores(Colors.white, Colors.purpleAccent, Colors.cyan),
Cores(Colors.pink, Colors.deepPurple, Colors.blueAccent),
Cores(Colors.pinkAccent, Colors.amber, Colors.lightBlue),
Cores(Colors.deepPurpleAccent, Colors.white, Colors.lightGreen),
SizedBox(
height: 100,
),
],
),
));
}
}
class Cores extends StatelessWidget {
final Color cor1;
final Color cor2;
final Color cor3;
const Cores(this.cor1,this.cor2, this.cor3,{Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Container( color: cor1, width: 90, height: 140,),
Container( color: cor2, width: 90, height: 140,),
Container( color: cor3, width: 90, height: 140,),
],
),
);
}
}