Balaji Lanka,CSE UI Design using Flutter
2 a) Explore various Flutter widgets (Text, Image, Container,
etc.).
import 'package:flutter/[Link]';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({[Link]});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Image'),
),
body: Center(
child: Container(
height: 200,
width: 300,
child:
[Link]('[Link]
7/[Link]'),
),
),
Balaji Lanka,CSE UI Design using Flutter
));
}
}
output :
2 b) Implement different layout structures using Row, Column,
and Stack widgets.
import 'package:flutter/[Link]';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
Balaji Lanka,CSE UI Design using Flutter
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Combined Layout Example')),
body: Center(
child: Column(
//mainAxisAlignment: [Link],
children: <Widget>[
Row(
//mainAxisAlignment: [Link],
children: <Widget>[
Container(color: [Link], width: 50, height: 50),
Container(color: [Link], width: 50, height: 50),
Container(color: [Link], width: 50, height: 50),
],
),
SizedBox(height: 20),
Stack(
alignment: [Link],
children: <Widget>[
Container(color: [Link], width: 200, height: 200),
Container(color: [Link], width: 150, height: 150),
Container(color: [Link], width: 100, height: 100),
],
),
],
),
),
),
);
}
}
Balaji Lanka,CSE UI Design using Flutter