1
resposta

[Projeto] Faça como eu fiz - Desafio

import 'package:flutter/material.dart';


void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Página Inicial',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Container(
        color: Colors.white,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Stack(
              alignment: AlignmentDirectional.center,
              children: [
                Container(color: Colors.red, width: 200, height: 200),
                Container(color: Colors.blue, width: 150, height: 150),
                Container(color: Colors.yellow, width: 48, height: 78),
              ],
            ),
            Stack(
              alignment: AlignmentDirectional.center,
              children: [
                Container(color: Colors.blue, width: 200, height: 200),
                Container(color: Colors.red, width: 150, height: 150),
                Container(color: Colors.yellow, width: 48, height: 78),
              ],
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(color: Colors.cyan, height: 50, width: 50),
                Container(color: Colors.pinkAccent, height: 50, width: 50),
                Container(color: Colors.purple, height: 50, width: 50),
              ],
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(color: Colors.cyan, height: 50, width: 50),
                Container(color: Colors.pinkAccent, height: 50, width: 50),
                Container(color: Colors.purple, height: 50, width: 50),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

!Abaixo o resultado:(https://cdn1.gnarususercontent.com.br/1/2027730/9ed8b11c-0302-4f85-af7c-7e1309a8f0f3.png)

1 resposta

Oii, Elaine!

Seu código tá muito bom e você conseguiu criar uma tela com vários Containers coloridos, usando Column, Row e Stack.

Muito obrigada por compartilhar com a gente!

Continue firme nos estudos.

Um abraço.