Flutter arvore de cadeia
25/03/2023
0
Não estou conseguindo colocar mais de uma child no body, child column e child container, e a imagem também esta dando issue
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Column(//primeira child coluna
children: [
Container(
padding: const EdgeInsets.all(12),
width: double.infinity,
height: 120,
decoration: BoxDecoration(
color: Colors.orange,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10),
bottomLeft: Radius.circular(10),
bottomRight: Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 2,
offset: const Offset(0, 3), // changes position of shadow
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset('assets/images/logo.png'),
Row(
children: [
TextButton(onPressed: () {}, child: const Text('Quem Somos')),
TextButton(onPressed: () {}, child: const Text('Contatos')),
],
),
],
),
),
],
)//fechamento do primeiro child
child: Container(//segundo child container
padding: const EdgeInsets.all(12),
width: 500,
height: 500,
child: Row(
Image.asset('/assests/images/logo.png')//aqui também esta dando erro!..?
children: const [
Column(
children: [
Text('nameProduct',
style: TextStyle(fontSize: 50,),),
Text('lorem', style: TextStyle(fontSize: 20),),
Text('preço', style: TextStyle(fontSize: 45, fontWeight: FontWeight.bold,),
),
],),],
),
),
),);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Column(//primeira child coluna
children: [
Container(
padding: const EdgeInsets.all(12),
width: double.infinity,
height: 120,
decoration: BoxDecoration(
color: Colors.orange,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10),
bottomLeft: Radius.circular(10),
bottomRight: Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 2,
offset: const Offset(0, 3), // changes position of shadow
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset('assets/images/logo.png'),
Row(
children: [
TextButton(onPressed: () {}, child: const Text('Quem Somos')),
TextButton(onPressed: () {}, child: const Text('Contatos')),
],
),
],
),
),
],
)//fechamento do primeiro child
child: Container(//segundo child container
padding: const EdgeInsets.all(12),
width: 500,
height: 500,
child: Row(
Image.asset('/assests/images/logo.png')//aqui também esta dando erro!..?
children: const [
Column(
children: [
Text('nameProduct',
style: TextStyle(fontSize: 50,),),
Text('lorem', style: TextStyle(fontSize: 20),),
Text('preço', style: TextStyle(fontSize: 45, fontWeight: FontWeight.bold,),
),
],),],
),
),
),);
}
}
Pedro
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)