0% found this document useful (0 votes)
30 views4 pages

Flutter Week 2

Uploaded by

dharnakarthik160
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)
30 views4 pages

Flutter Week 2

Uploaded by

dharnakarthik160
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

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

You might also like