Boa noite. Eu queria mostrar um pouco o meu código que eu fiz, sei que ainda da para melhorar, mas fiz o que eu consegui absorver.
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: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed( seedColor: const Color.fromARGB(255, 104, 30, 233)), useMaterial3: true, ), home: const MyHomePage(title: 'Flutter Primeiros Passos'), ); } }
class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title});
final String title;
@override State createState() => _MyHomePageState(); }
class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title), ), body: Container( child: ListView( children: [ Flag( Colors.white, Colors.pinkAccent, Colors.lightBlueAccent, 100, Icons.people, ), Flag( Colors.pink, Colors.purple, Colors.blueAccent, 100, Icons.people, ), Flag( Colors.pinkAccent, Colors.amber, Colors.lightBlue, 100, Icons.people, ), Flag( Colors.purpleAccent, Colors.white, Colors.green, 100, Icons.people, ), ], ), ), ); } }
class Flag extends StatelessWidget { const Flag(this.cor1, this.cor2, this.cor3, this.largura, this.icon, {super.key});
final Color cor1; final Color cor2; final Color cor3; final double largura; final IconData icon;
@override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(8.0), child: Row( children: [ Container( height: 140, width: largura, decoration: BoxDecoration( color: cor1, borderRadius: BorderRadius.circular(20), border: Border.all(color: Colors.black, width: 3), ), ), Container( height: 140, width: largura, decoration: BoxDecoration( color: cor2, borderRadius: BorderRadius.circular(20), border: Border.all(color: Colors.black, width: 3), ), child: Icon(icon), ), Container( height: 140, width: largura, decoration: BoxDecoration( color: cor3, borderRadius: BorderRadius.circular(20), border: Border.all(color: Colors.black, width: 3), ), ), ], ), ); } }