Skip to content

Commit

Permalink
Basic profile screen done
Browse files Browse the repository at this point in the history
  • Loading branch information
AshutoshPatole committed Nov 18, 2021
1 parent fa1bb0f commit 8ac5700
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 19 deletions.
38 changes: 21 additions & 17 deletions lib/views/drawer_page/drawer_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
),
DrawerList(
index: DrawerIndex.feedback,
labelName: 'FeedBack',
labelName: 'Advice',
icon: const Icon(CupertinoIcons.chat_bubble_text),
),
DrawerList(
Expand Down Expand Up @@ -102,22 +102,26 @@ class _HomeDrawerState extends State<HomeDrawer> {
},
child: Stack(
children: [
Container(
height: size.height * 0.125,
width: size.width * 0.25,
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: <BoxShadow>[
BoxShadow(
color: AppTheme.grey
.withOpacity(0.6),
offset: const Offset(2.0, 4.0),
blurRadius: 8),
],
),
child: CircleAvatar(
foregroundImage: NetworkImage(
"${model.user!.photoURL}"),
Hero(
tag: "photoURL",
child: Container(
height: size.height * 0.125,
width: size.width * 0.25,
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: <BoxShadow>[
BoxShadow(
color: AppTheme.grey
.withOpacity(0.6),
offset:
const Offset(2.0, 4.0),
blurRadius: 8),
],
),
child: CircleAvatar(
foregroundImage: NetworkImage(
"${model.user!.photoURL}"),
),
),
),
const Positioned(
Expand Down
57 changes: 55 additions & 2 deletions lib/views/edit_profile_page/edit_profile_page_view.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,70 @@
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'package:zerosandones/theme/app_theme.dart';
import 'package:zerosandones/widgets/dumb_widgets/profile_row.dart';
import 'edit_profile_page_view_model.dart';

class EditProfilePageView extends StatelessWidget {
const EditProfilePageView({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
Size _size = MediaQuery.of(context).size;
return ViewModelBuilder<EditProfilePageViewModel>.reactive(
builder: (BuildContext context, EditProfilePageViewModel viewModel, _) {
return Scaffold(
body: Center(
child: Text('EditProfilePage View'),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Profile",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 24.0,
),
),
SizedBox(
height: _size.height * 0.05,
),
Align(
alignment: Alignment.center,
child: Hero(
tag: "photoURL",
child: Container(
height: _size.height * 0.2,
width: _size.width * 0.35,
decoration: BoxDecoration(
shape: BoxShape.circle,
boxShadow: <BoxShadow>[
BoxShadow(
color: AppTheme.grey.withOpacity(0.6),
offset: const Offset(2.0, 4.0),
blurRadius: 8),
],
),
child: CircleAvatar(
foregroundImage:
NetworkImage("${viewModel.user.photoURL}"),
),
),
),
),
SizedBox(
height: _size.height * 0.05,
),
ProfileRow(
itemName: "Name", itemData: viewModel.user.displayName!),
ProfileRow(
itemName: "Email", itemData: viewModel.user.email!),
ProfileRow(
itemName: "Phone Number",
itemData: viewModel.user.phoneNumber ?? "N/A"),
],
),
),
),
);
},
Expand Down
2 changes: 2 additions & 0 deletions lib/views/edit_profile_page/edit_profile_page_view_model.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:logger/logger.dart';
import 'package:stacked/stacked.dart';
import 'package:zerosandones/core/logger.dart';
Expand All @@ -8,4 +9,5 @@ class EditProfilePageViewModel extends BaseViewModel {
EditProfilePageViewModel() {
log = getLogger(runtimeType.toString());
}
User user = FirebaseAuth.instance.currentUser!;
}
34 changes: 34 additions & 0 deletions lib/widgets/dumb_widgets/profile_row.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';

class ProfileRow extends StatelessWidget {
final String itemName;
final String itemData;
const ProfileRow({Key? key, required this.itemName, required this.itemData})
: super(key: key);

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
itemName,
style: const TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w400,
),
),
Text(
itemData,
style: const TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w700,
),
),
],
),
);
}
}

0 comments on commit 8ac5700

Please sign in to comment.