Widget - Parte 3
24/10/2022
Thomas MARQUES
import 'package:flutter/material.dart';
class LearnFlutterPage extends StatefulWidget {
const LearnFlutterPage({Key? key}) : super(key: key);
@override
State<LearnFlutterPage> createState() => _LearnFlutterPageState();
}
class _LearnFlutterPageState extends State<LearnFlutterPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Learn Flutter'),
),
body: Column(
children: [
Image.asset('images/Inatel.jpg.webp'),
const SizedBox(height: 10,),
const Divider(color: Colors.black,),
Container(
margin : const EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
width: double.infinity,
color : Colors.blueGrey,
child: const Center(
child: Text(
'This is a text Widget',
style: TextStyle(
color: Colors.white,
fontSize: 25,
),
),
),
),
ElevatedButton(
onPressed: (){
debugPrint('ElevatedButton');
},
child: const Text('Elevated Button'),
),
OutlinedButton(
onPressed: (){
debugPrint('OutlinedButton');
},
child: const Text('Outlined Button'),
),
TextButton(
onPressed: (){
debugPrint('TextButton');
},
child: const Text('Text Button'),
),
GestureDetector(
onTap: (){
debugPrint('This is the row');
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const[
Icon(
Icons.smartphone,
color: Colors.blue,
),
Text('Row Widget'),
Icon(
Icons.laptop,
color: Colors.blue,
)
],
),
)
],
),
);
}
}