0% found this document useful (0 votes)
7 views

Assignment 7

Flutter 66

Uploaded by

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

Assignment 7

Flutter 66

Uploaded by

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

import 'package:flutter/material.

dart';

class Updatepg extends StatelessWidget {


const Updatepg({super.key});

@override
Widget build(BuildContext context) {
final List<Map<String, dynamic>> person = [
{
"Name": "WhatsApp",
"tasvir":
"https://encrypted-
tbn0.gstatic.com/images?q=tbn:ANd9GcRnFT4jgC5rD5oTk24xpPadS_SOlkzU6EfWwA&s",
},
{
"Name": "Matlabi Duniya",
"tasvir":
"https://qph.cf2.quoracdn.net/main-thumb-2547083753-200-
tzgvwgizrtaazkmkwhyizntdeexdoggk.jpeg",
},
{
"Name": "Aaj Tak",
"tasvir":
"https://pbs.twimg.com/profile_images/1395254075285860354/LG45JNi8_40
0x400.jpg",
},
{
"Name": "Who Cares?",
"tasvir":
"https://media.licdn.com/dms/image/C560BAQHY5gVjRBSDkg/company-
logo_200_200/0/1631393464491?e=2147483647&v=beta&t=8V2qJ9Sh1gcXvs30UvcCsX21yUm_pQ
ovqO2P-E_W_EU",
},
{
"Name": "Amala Shaji",
"tasvir":
"https://encrypted-
tbn0.gstatic.com/images?q=tbn:ANd9GcQpJM2KFiGDBPamsjXBvLTl_4OuGl8y2OK0sg&s",
},
];
final List<Map<String, dynamic>> update = [
{
"photo":
"https://encrypted-
tbn0.gstatic.com/images?q=tbn:ANd9GcTLK5rlDK3eXn2HzEn_bieMdXRW-o0fUKbrdg&s",
"naam": "Virat Kohli",
"vel": "55 minutes ago",
},
{
"photo":
"https://th.bing.com/th/id/OIP.xbxMmcIw10tMuh1jRTG2pAHaEo?rs=1&pid=Im
gDetMain",
"naam": "Roronoa Zoro",
"vel": "9 minutes ago",
},
{
"photo":
"https://th.bing.com/th?id=OIF.jitsUl7%2fVcBkuDT%2bctBwYg&rs=1&pid=Im
gDetMain",
"naam": "Rohit Sharma",
"vel": "30 minutes ago",
},
{
"photo":
"https://img1.hscicdn.com/image/upload/f_auto,t_ds_square_w_320,q_50/
lsci/db/PICTURES/CMS/319900/319940.png",
"naam": "Jasprit Bumrah",
"vel": "45 minutes ago",
},
];
return Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () {},
backgroundColor: const Color.fromARGB(255, 54, 178, 58),
foregroundColor: Colors.black,
child: const Icon(Icons.camera_alt_rounded),
),
backgroundColor: Colors.black,
appBar: AppBar(
backgroundColor: Colors.black,
title: const Text(
"Updates",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
actions: const [
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
Icons.qr_code_scanner_rounded,
color: Colors.white,
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.camera_alt_outlined, color: Colors.white),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.search, color: Colors.white),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.more_vert, color: Colors.white),
),
],
),
body: SingleChildScrollView(
child: Column(
children: [
const Padding(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Status",
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.white),
),
Icon(Icons.more_vert)
],
),
),
const SizedBox(height: 2),
const ListTile(
tileColor: Colors.black,
leading: CircleAvatar(
radius: 20,
backgroundImage: NetworkImage(
"https://encrypted-
tbn0.gstatic.com/images?q=tbn:ANd9GcSNZnWZWeOVMGkA4n1WHnpyYOutj7kcgsBYLg&s"),
),
title: Text(
"My Status",
style:
TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
),
subtitle: Text("Tap to add status update",
style: TextStyle(color: Colors.white)),
),
const Padding(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Recent Updates",
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.grey),
),
],
),
),
const SizedBox(height: 6),
ListView.builder(
itemCount: update.length,
shrinkWrap: true,
itemBuilder: (context, index) {
final status = update[index];
return Story(
image: status["photo"],
name: status["naam"],
time: status["vel"],
);
},
),
const SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
decoration: const InputDecoration(
hintText: "Viewed updates",
hintStyle: TextStyle(color: Colors.grey),
suffixIcon: Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)),
),
),
const SizedBox(height: 10),
const Padding(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Channels",
style: TextStyle(
fontWeight: FontWeight.bold, color: Colors.white),
),
Icon(Icons.add, color: Colors.white)
],
),
),
SizedBox(
height: 180,
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemCount: person.length,
itemBuilder: (context, index) {
final community = person[index];
return Channel(
channelname: community["Name"],
picture: community["tasvir"],
);
}),
),
const SizedBox(
height: 5,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)),
minimumSize: const Size(45, 45),
backgroundColor:
const Color.fromARGB(255, 54, 178, 58)),
onPressed: () {},
child: const Text(
"Explore more",
style: TextStyle(color: Colors.black),
)),
)
],
)
],
),
),
);
}
}

class Channel extends StatelessWidget {


final String picture, channelname;
const Channel({super.key, required this.channelname, required this.picture});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 150,
width: 150,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(7),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
CircleAvatar(
radius: 26,
backgroundImage: NetworkImage(picture),
),
Text(channelname,
style:
const TextStyle(color: Colors.white, fontSize: 18)),
ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
minimumSize: const Size(50, 8),
backgroundColor:
const Color.fromARGB(255, 56, 122, 55)),
onPressed: () {},
child: const Text("Follow",
style: TextStyle(color: Colors.white)),
),
],
),
),
),
],
),
);
}
}

class Story extends StatelessWidget {


final String image, name, time;
const Story(
{super.key, required this.image, required this.name, required this.time});

@override
Widget build(BuildContext context) {
return ListTile(
tileColor: Colors.black,
leading: CircleAvatar(
radius: 35,
backgroundColor: Colors.green,
child: CircleAvatar(
radius: 20,
backgroundImage: NetworkImage(image),
),
),
title: Text(
name,
style:
const TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
),
subtitle: Text(
time,
style: const TextStyle(color: Colors.grey),
),
);
}
}

import 'package:flutter/material.dart';

class Chatpg extends StatelessWidget {


const Chatpg({super.key});

@override
Widget build(BuildContext context) {
final List<Map<String, dynamic>> people = [
{
"pic":
"https://encrypted-
tbn0.gstatic.com/images?q=tbn:ANd9GcTLK5rlDK3eXn2HzEn_bieMdXRW-o0fUKbrdg&s",
"naav": "Virat Kohli",
"msg": "Ee Salla Cup Namde",
},
{
"pic":
"https://th.bing.com/th/id/OIP._dscY2Od2Np1uNGB8LRFkAHaGI?rs=1&pid=ImgDetMain",
"naav": "Monkey D Luffy",
"msg": "Orewa Monkey D Luffy",
},
{
"pic":
"https://static.theprint.in/wp-content/uploads/2022/11/ANI-
20221122143001.jpg",
"naav": "Surya Bhau",
"msg": "My Favorite Shot is Supla Shot",
},
{
"pic":
"https://img1.hscicdn.com/image/upload/f_auto,t_ds_square_w_320,q_50/
lsci/db/PICTURES/CMS/319900/319940.png",
"naav": "Jasprit Bumrah",
"msg": "Boom Boom Boom Boom",
},
{
"pic":
"https://th.bing.com/th/id/OIP.xbxMmcIw10tMuh1jRTG2pAHaEo?rs=1&pid=Im
gDetMain",
"naav": "Roronoa Zoro",
"msg":
"kay kartoy luffy bhai",
},
{
"pic":
"https://th.bing.com/th?id=OIF.8wI4awYQGUCFp%2bMbHZeFUQ&rs=1&pid=ImgD
etMain",
"naav": "Rishab Pant",
"msg": "Aaj Gadi tera bhai chalayga",
},
{
"pic":
"https://th.bing.com/th?id=OIF.jitsUl7%2fVcBkuDT%2bctBwYg&rs=1&pid=ImgDetMain",
"naav": "Rohit Sharma",
"msg": "ye Pat Cummins ko jaldi Silent Karna hoga",
},
{
"pic":
"https://th.bing.com/th/id/OIF.xYKL7Z2nLMd1a5h9HACJlg?rs=1&pid=ImgDet
Main",
"naav": "hardik pandya",
"msg": "ipl 2025 apna hai bhai",
},
];
return Scaffold(
floatingActionButton: FloatingActionButton(
foregroundColor: Colors.white,
backgroundColor: const Color.fromARGB(255, 54, 178, 58),
onPressed: () {},
child: const Icon(
Icons.message_rounded,
),
),
backgroundColor: const Color.fromARGB(255, 14, 15, 17),
appBar: AppBar(
backgroundColor: const Color.fromARGB(255, 14, 15, 17),
title: const Text(
"WhatsApp",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.w400),
),
actions: const [
Padding(
padding: EdgeInsets.only(top: 8.0, right: 20),
child: Icon(Icons.qr_code_scanner, color: Colors.white),
),
Padding(
padding: EdgeInsets.only(top: 8, right: 20),
child: Icon(Icons.camera_alt_outlined, color: Colors.white),
),
Padding(
padding: EdgeInsets.only(top: 8, right: 20),
child: Icon(Icons.more_vert,
color: Color.fromARGB(255, 241, 233, 233)),
),
],
),
body: Padding(
padding: const EdgeInsets.all(8),
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
children: [
TextFormField(
decoration: InputDecoration(
filled: true,
fillColor: const Color.fromARGB(255, 74, 73, 73),
prefixIcon: Padding(
padding: const EdgeInsets.all(16.0),
child: Icon(
Icons.search_rounded,
color: Colors.grey[300],
),
),
hintText: "Search...",
hintStyle: TextStyle(color: Colors.grey[300]),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30))),
),
const SizedBox(height: 15),
ListView.builder(
itemCount: people.length,
shrinkWrap: true,
itemBuilder: (context, index) {
final person = people[index];
return Message(
dp: person["pic"],
name: person["naav"],
chat: person["msg"],
);
})
],
),
),
),
);
}
}

class Message extends StatelessWidget {


final String dp, name, chat;
const Message(
{super.key, required this.chat, required this.dp, required this.name});

@override
Widget build(BuildContext context) {
return ListTile(
leading: CircleAvatar(
radius: 30,
backgroundImage: NetworkImage(dp),
),
title: Text(
name,
style: const TextStyle(color: Colors.white, fontSize: 20),
),
subtitle: Text(
overflow: TextOverflow.ellipsis,
maxLines: 1,
chat,
style: TextStyle(color: Colors.grey[600]),
),
trailing: Text(
DateTime.now().toString().substring(10, 16),
style: TextStyle(color: Colors.grey[600]),
),
);
}
}

You might also like