feat: current user
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
|
||||
import '../../../../common/extension/extension.dart';
|
||||
import '../../../../common/theme/theme.dart';
|
||||
import '../../../../domain/auth/auth.dart';
|
||||
import 'divider.dart';
|
||||
import 'profile_tile.dart';
|
||||
|
||||
class ProfileAccountInfo extends StatelessWidget {
|
||||
const ProfileAccountInfo({super.key});
|
||||
final User user;
|
||||
const ProfileAccountInfo({super.key, required this.user});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -38,9 +42,9 @@ class ProfileAccountInfo extends StatelessWidget {
|
||||
),
|
||||
|
||||
ProfileTile(
|
||||
icon: Icons.email_outlined,
|
||||
icon: LineIcons.envelope,
|
||||
title: 'Email',
|
||||
subtitle: 'john.doe@business.com',
|
||||
subtitle: user.email,
|
||||
onTap: () {
|
||||
// Edit email
|
||||
},
|
||||
@@ -49,31 +53,9 @@ class ProfileAccountInfo extends StatelessWidget {
|
||||
ProfileDivider(),
|
||||
|
||||
ProfileTile(
|
||||
icon: Icons.phone_outlined,
|
||||
title: 'Phone Number',
|
||||
subtitle: '+62 812 3456 7890',
|
||||
onTap: () {
|
||||
// Edit phone
|
||||
},
|
||||
),
|
||||
|
||||
ProfileDivider(),
|
||||
|
||||
ProfileTile(
|
||||
icon: Icons.location_on_outlined,
|
||||
title: 'Address',
|
||||
subtitle: 'Jl. Merdeka No. 123, Jakarta',
|
||||
onTap: () {
|
||||
// Edit address
|
||||
},
|
||||
),
|
||||
|
||||
ProfileDivider(),
|
||||
|
||||
ProfileTile(
|
||||
icon: Icons.calendar_today_outlined,
|
||||
icon: LineIcons.calendarAlt,
|
||||
title: 'Member Since',
|
||||
subtitle: 'January 15, 2024',
|
||||
subtitle: user.createdAt.toDate,
|
||||
showArrow: false,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import '../../../../common/extension/extension.dart';
|
||||
import '../../../../common/painter/wave_painter.dart';
|
||||
import '../../../../common/theme/theme.dart';
|
||||
import '../../../../domain/auth/auth.dart';
|
||||
import '../../../components/spacer/spacer.dart';
|
||||
|
||||
class ProfileHeader extends StatefulWidget {
|
||||
const ProfileHeader({super.key});
|
||||
final User user;
|
||||
const ProfileHeader({super.key, required this.user});
|
||||
|
||||
@override
|
||||
State<ProfileHeader> createState() => _ProfileHeaderState();
|
||||
@@ -347,7 +350,7 @@ class _ProfileHeaderState extends State<ProfileHeader>
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'John Doe',
|
||||
widget.user.name,
|
||||
style: AppStyle.h5.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColor.textWhite,
|
||||
@@ -408,7 +411,7 @@ class _ProfileHeaderState extends State<ProfileHeader>
|
||||
),
|
||||
const SpaceHeight(6),
|
||||
Text(
|
||||
'Business Owner',
|
||||
widget.user.role.toTitleCase,
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.textWhite,
|
||||
fontWeight: FontWeight.w600,
|
||||
|
||||
Reference in New Issue
Block a user