Skip to content

Commit

Permalink
Added SettingsScreen > ProfileScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
shyvum committed Aug 16, 2019
1 parent 2d44292 commit 480e29e
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 25 deletions.
110 changes: 110 additions & 0 deletions lib/pages/SettingScreens/ProfileSettingScreen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import 'package:WhatsApp/models/chat_model.dart';
import 'package:flutter/material.dart';

class ProfileSettingScreen extends StatefulWidget {
@override
_ProfileSettingScreenState createState() => _ProfileSettingScreenState();
}

class _ProfileSettingScreenState extends State<ProfileSettingScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
resizeToAvoidBottomPadding: true,
appBar: AppBar(
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"Profile",
style: TextStyle(fontSize: 24.0),
),
],
),
),
body: ListView(
children: <Widget>[
Container(
padding: EdgeInsets.symmetric(vertical: 20.0),
alignment: Alignment.center,
child: Stack(
alignment: Alignment.bottomRight,
children: <Widget>[
GestureDetector(
child: CircleAvatar(
foregroundColor: Theme.of(context).primaryColor,
backgroundColor: Colors.grey,
backgroundImage: AssetImage(dummyData[2].avatarUrl),
radius: 80.0,
),
onTap: () {},
),
Positioned(
child: GestureDetector(
onTap: () {},
child: Container(
width: 50.0,
height: 50.0,
child: FloatingActionButton(
mini: true,
shape: StadiumBorder(),
onPressed: null,
backgroundColor: Theme.of(context).primaryColor,
child: Icon(
Icons.camera_alt,
color: Colors.white,
size: 23.0,
),
),
),
)),
],
),
),
ListTile(
leading:
IconButton(icon: Icon(Icons.person, color: Color(0xFF6CB3A7))),
title: Text("Name",
style: TextStyle(fontSize: 14.0, color: Colors.grey[600])),
subtitle: Text("Shivam Goyal",
style: TextStyle(fontSize: 16.0, color: Colors.black)),
trailing:
IconButton(icon: Icon(Icons.edit, color: Colors.grey[400])),
onTap: () {},
),
Container(
alignment: Alignment.centerRight,
child: Divider(height: 0.0),
padding: EdgeInsets.only(left: 80.0),
),
ListTile(
leading: IconButton(
icon: Icon(Icons.info_outline, color: Color(0xFF6CB3A7))),
title: Text("About",
style: TextStyle(fontSize: 14.0, color: Colors.grey[600])),
subtitle: Text("Hey there! I'm using WhatsApp.",
style: TextStyle(fontSize: 16.0, color: Colors.black)),
onTap: () {},
trailing:
IconButton(icon: Icon(Icons.edit, color: Colors.grey[400])),
),
Container(
alignment: Alignment.centerRight,
child: Divider(height: 0.0),
padding: EdgeInsets.only(left: 80.0),
),
ListTile(
leading:
IconButton(icon: Icon(Icons.phone, color: Color(0xFF6CB3A7))),
title: Text("Phone",
style: TextStyle(fontSize: 14.0, color: Colors.grey[600])),
subtitle: Text("+91 90122 18994",
style: TextStyle(fontSize: 16.0, color: Colors.black)),
onTap: () {},
),
],
),
);
}
}
105 changes: 105 additions & 0 deletions lib/pages/SettingScreens/SettingMainScreen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import 'package:WhatsApp/models/chat_model.dart';
import 'package:flutter/material.dart';

import 'ProfileSettingScreen.dart';

class SettingMainScreen extends StatefulWidget {
@override
_SettingMainScreenState createState() => _SettingMainScreenState();
}

class _SettingMainScreenState extends State<SettingMainScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
resizeToAvoidBottomPadding: true,
appBar: AppBar(
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"Settings",
style: TextStyle(fontSize: 24.0),
),
],
),
),
body: ListView(
children: <Widget>[
Container(
height: 100.0,
child: ListTile(
contentPadding: EdgeInsets.only(
top: 15.0, bottom: 15.0, left: 20.0, right: 20.0),
leading: CircleAvatar(
backgroundImage: AssetImage(dummyData[2].avatarUrl),
radius: 25.0,
),
title: Text(
"Shivam Goyal",
style: TextStyle(fontSize: 20.0),
),
subtitle: Text("Hey there! I'm using WhatsApp."),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ProfileSettingScreen()), // MessageScreen(i)
);
},
),
),
Divider(height: 0.0),
ListTile(
leading:
IconButton(icon: Icon(Icons.vpn_key, color: Color(0xFF6CB3A7))),
title: Text("Account"),
subtitle: Text("Privacy, security, change number"),
onTap: () {},
),
ListTile(
leading:
IconButton(icon: Icon(Icons.chat, color: Color(0xFF6CB3A7))),
title: Text("Chats"),
subtitle: Text("Backup, history, wallpaper"),
onTap: () {},
),
ListTile(
leading: IconButton(
icon: Icon(Icons.notifications, color: Color(0xFF6CB3A7))),
title: Text("Notifications"),
subtitle: Text("Message, group & call tones"),
onTap: () {},
),
ListTile(
leading: IconButton(
icon: Icon(Icons.data_usage, color: Color(0xFF6CB3A7))),
title: Text("Data and storage usage"),
subtitle: Text("Network usage, auto-download"),
onTap: () {},
),
ListTile(
leading: IconButton(
icon: Icon(Icons.help_outline, color: Color(0xFF6CB3A7))),
title: Text("Help"),
subtitle: Text("FAQ, contact us, privacy policy"),
onTap: () {},
),
Container(
alignment: Alignment.centerRight,
child: Divider(),
padding: EdgeInsets.only(left: 80.0),
),
ListTile(
leading:
IconButton(icon: Icon(Icons.people, color: Color(0xFF6CB3A7))),
title: Text("Invite a friend"),
onTap: () {},
),
],
),
);
}
}
62 changes: 37 additions & 25 deletions lib/whatsapp_home.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'pages/SettingScreens/SettingMainScreen.dart';
import 'pages/camera_screen.dart';
import 'pages/chat_screen.dart';
import 'pages/status_screen.dart';
Expand Down Expand Up @@ -38,6 +39,16 @@ class _WhatsAppHomeState extends State<WhatsAppHome>
setState(() {});
}

void choiceActions(MoreMenu choice) {
if (choice == MoreMenu.setting) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SettingMainScreen()), // MessageScreen(i)
);
}
}

@override
Widget build(BuildContext context) {
return new Scaffold(
Expand Down Expand Up @@ -79,33 +90,34 @@ class _WhatsAppHomeState extends State<WhatsAppHome>
onPressed: () {},
),
new PopupMenuButton<MoreMenu>(
onSelected: choiceActions,
tooltip: "More options",
itemBuilder: (BuildContext context) => <PopupMenuEntry<MoreMenu>>[
const PopupMenuItem<MoreMenu>(
value: MoreMenu.new_group,
child: Text('New group'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.new_broadcast,
child: Text('New broadcast'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.web,
child: Text('WhatsApp Web'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.starred,
child: Text('Starred messages'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.payment,
child: Text('Payments'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.setting,
child: Text('Settings'),
),
],
const PopupMenuItem<MoreMenu>(
value: MoreMenu.new_group,
child: Text('New group'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.new_broadcast,
child: Text('New broadcast'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.web,
child: Text('WhatsApp Web'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.starred,
child: Text('Starred messages'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.payment,
child: Text('Payments'),
),
const PopupMenuItem<MoreMenu>(
value: MoreMenu.setting,
child: Text('Settings'),
),
],
),
],
),
Expand Down

0 comments on commit 480e29e

Please sign in to comment.