EXPERIMENT-2A
AIM: Explore various flutter widgets (Text,Image,Container,etc).
DESCRIPTION:
Text Widget → Displays styled text.
Image Widget → Loads an image from the internet.
Container Widget → Adds background color, padding, margin, and rounded corners.
PROGRAM:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Basic Widgets Demo',
home: Scaffold(
appBar: AppBar(
title: Text("Basic Flutter Widgets"),
backgroundColor: Colors.blueAccent,),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text
"Hello, Flutter!",
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.blue,))
SizedBox(height: 20),
Image.network(
"https://flutter.dev/images/flutter-logo-sharing.png",
width: 150,
height: 150,)
SizedBox(height: 20),
Container(
padding: EdgeInsets.all(16),
margin: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.amber,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black26,
blurRadius: 6,
offset: Offset(2, 4),),],),
child: Text(
"This is inside a Container",
style: TextStyle(fontSize: 18, color: Colors.black87),),),],
CONCLUSION: This program helps beginners understand how to display text, load images, and style UI
elements inside a container, which is the foundation for creating more complex Flutter applications.
Output :