[go: up one dir, main page]

0% found this document useful (0 votes)
9 views9 pages

Atividade_flutter_3

Uploaded by

luvalvite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

Atividade_flutter_3

Uploaded by

luvalvite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Atividade flutter 3

Obs: "pubspec.yaml" de seu projeto: precisa estar do jeito ai abaixo


flutter:

# The following line ensures that the Material Icons font is

# included with your application, so that you can use the icons in

# the material Icons class.

uses-material-design: true

assets:

- img/mulher.jpg

- img/psg.jpg

Exercício 1

import 'package:flutter/material.dart';

void main() => runApp(

MaterialApp(

home: Home(),

debugShowCheckedModeBanner: false,

),

);

class Home extends StatelessWidget {

@override

Widget build(BuildContext context) {

return Scaffold(

appBar: AppBar(

leading: const Icon(Icons.home),


title: const Text('Página Inicial'),

),

body: Center(

child: Container(

width: 300,

height: 300,

decoration: BoxDecoration(

color: Colors.yellow, // Define o fundo como amarelo

shape: BoxShape.circle, // Define o formato circular

boxShadow: const [

BoxShadow(

color: Colors.grey,

spreadRadius: 2,

blurRadius: 5,

),

],

),

child: Center(

child: Container(

width: 150,

height: 150,

decoration: BoxDecoration(

color: Colors.white, // Define o fundo da foto como branco

borderRadius: BorderRadius.circular(10), // Define o formato quadrado

),

child: Image.asset(

'/img/ps.jpg',

width: 100,

height: 100,

fit: BoxFit.cover,

),
),

),

),

),

floatingActionButton: const FloatingActionButton(

onPressed: null,

tooltip: 'Exemplo de botão',

child: Icon(Icons.add),

),

);

Exercício 2

import 'package:flutter/material.dart';

void main() => runApp(


MaterialApp(

home: Home(),

debugShowCheckedModeBanner: false,

),

);

class Home extends StatelessWidget {

@override

Widget build(BuildContext context) {

return Scaffold(

appBar: AppBar(

leading: const Icon(Icons.home),

title: const Text('Página Inicial'),

),

body: Center(

child: Column(

mainAxisAlignment: MainAxisAlignment.center,

crossAxisAlignment: CrossAxisAlignment.center,

children: [

Container(

height: 200,

width: 200,

decoration: BoxDecoration(

borderRadius: BorderRadius.circular(7),

image: const DecorationImage(

image: AssetImage('/img/mulher.jpg'),

fit: BoxFit.cover,

),

boxShadow: const [

BoxShadow(
color: Colors.grey,

spreadRadius: 2,

blurRadius: 5,

),

],

),

),

SizedBox(height: 20), // Espaço entre as imagens

Container(

height: 200,

width: 200,

decoration: BoxDecoration(

borderRadius: BorderRadius.circular(7),

image: const DecorationImage(

image: AssetImage('/img/psg.jpg'),

fit: BoxFit.cover,

),

boxShadow: const [

BoxShadow(

color: Colors.grey,

spreadRadius: 2,

blurRadius: 5,

),

],

),

),

],

),

),

floatingActionButton: const FloatingActionButton(

onPressed: null,
tooltip: "Exemplo de botão",

child: Icon(Icons.add),

),

);

Exercicio 3

import 'package:flutter/material.dart';

void main() => runApp(

MaterialApp(

home: Home(),

debugShowCheckedModeBanner: false,

),

);
class Home extends StatelessWidget {

@override

Widget build(BuildContext context) {

return Scaffold(

appBar: AppBar(

leading: const Icon(Icons.home),

title: const Text('Página Inicial'),

),

body: Center(

child: Row( // row faz a imagem ficar lado a lado

mainAxisAlignment: MainAxisAlignment.center,

crossAxisAlignment: CrossAxisAlignment.center,

children: [

Container(

height: 200,

width: 200,

decoration: BoxDecoration(

borderRadius: BorderRadius.circular(7),

image: const DecorationImage(

image: AssetImage('/img/mulher.jpg'),

fit: BoxFit.cover,

),

boxShadow: const [

BoxShadow(

color: Colors.grey,

spreadRadius: 2,

blurRadius: 5,

),

],

),

),
SizedBox(width: 20), // Espaço entre as imagens na horizontal

Container(

height: 200,

width: 200,

decoration: BoxDecoration(

borderRadius: BorderRadius.circular(7),

image: const DecorationImage(

image: AssetImage('/img/psg.jpg'),

fit: BoxFit.cover,

),

boxShadow: const [

BoxShadow(

color: Colors.grey,

spreadRadius: 2,

blurRadius: 5,

),

],

),

),

],

),

),

floatingActionButton: const FloatingActionButton(

onPressed: null,

tooltip: "Exemplo de botão",

child: Icon(Icons.add),

),

);

You might also like