-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature Request: Display username, email address, and profile photo f…
…rom firebase authentication Fixes #15
- Loading branch information
Showing
14 changed files
with
201 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import 'dart:developer'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:udayah/widgets/category_box.dart'; | ||
|
||
import '../provider/auth.dart'; | ||
|
||
class ProfilePage extends StatefulWidget { | ||
const ProfilePage({super.key}); | ||
|
||
@override | ||
State<ProfilePage> createState() => _ProfilePageState(); | ||
} | ||
|
||
class _ProfilePageState extends State<ProfilePage> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Consumer<AuthProvider>( | ||
builder: (context, data, child) { | ||
log("User: ${data.user}"); | ||
if (data.user == null) { | ||
return const Center( | ||
child: CircularProgressIndicator(), | ||
); | ||
} | ||
final photoURL = data.user?.photoURL; | ||
final displayName = data.user?.displayName; | ||
final email = data.user?.email; | ||
|
||
return CategoryBox( | ||
title: "Profile", | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
const SizedBox(height: 50), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
children: [ | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text("Name"), | ||
Text( | ||
displayName ?? "User", | ||
style: const TextStyle( | ||
fontSize: 36, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
const SizedBox(height: 10), | ||
const Text("Email"), | ||
Text( | ||
email ?? "No Email Provided", | ||
style: const TextStyle( | ||
fontSize: 36, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
], | ||
), | ||
// Displays User Profile Picture if available other | ||
CircleAvatar( | ||
radius: 100, | ||
backgroundImage: | ||
photoURL != null ? NetworkImage(photoURL) : null, | ||
child: photoURL == null | ||
? const Icon(Icons.person, size: 50) | ||
: null, | ||
), | ||
], | ||
), | ||
const SizedBox(height: 20), | ||
], | ||
); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters