+ChangeNotifier Fixes
+Signout Fixes +
This commit is contained in:
@@ -11,17 +11,17 @@ class ProfilePage extends StatelessWidget {
|
||||
|
||||
final double _deviceHeight;
|
||||
final double _deviceWidth;
|
||||
late MessagingProviders _auth;
|
||||
|
||||
MessagingProviders _auth = MessagingProviders.instance;
|
||||
|
||||
ProfilePage(this._deviceHeight, this._deviceWidth, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return SizedBox(
|
||||
height: _deviceHeight,
|
||||
width: _deviceWidth,
|
||||
child: ChangeNotifierProvider<MessagingProviders>.value(
|
||||
value: MessagingProviders.instance,
|
||||
value: _auth,
|
||||
child: _profilePageUI(),
|
||||
),
|
||||
);
|
||||
@@ -29,10 +29,11 @@ class ProfilePage extends StatelessWidget {
|
||||
|
||||
Widget _profilePageUI() {
|
||||
return Builder(builder: (BuildContext _context) {
|
||||
// assert(_auth.user != null);
|
||||
SnackBarService.instance.buildContext = _context;
|
||||
_auth = Provider.of<MessagingProviders>(_context);
|
||||
return StreamBuilder<User>(
|
||||
stream: MessagingProviders.instance.getUser(_auth.user!.$id),
|
||||
stream: _auth.getUser(_auth.user!.$id),
|
||||
builder: (_, _snapshot) {
|
||||
var _userData = _snapshot.data;
|
||||
return _snapshot.hasData
|
||||
@@ -76,7 +77,7 @@ class ProfilePage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _userNameWidget(String _name) {
|
||||
return Container(
|
||||
return SizedBox(
|
||||
height: _deviceHeight * 0.05,
|
||||
width: _deviceWidth,
|
||||
child: Text(
|
||||
@@ -91,7 +92,7 @@ class ProfilePage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _userEmailWidget(String _email) {
|
||||
return Container(
|
||||
return SizedBox(
|
||||
height: _deviceHeight * 0.03,
|
||||
width: _deviceWidth,
|
||||
child: Text(
|
||||
@@ -106,7 +107,7 @@ class ProfilePage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _logoutButton() {
|
||||
return Container(
|
||||
return SizedBox(
|
||||
height: _deviceHeight * 0.06,
|
||||
width: _deviceWidth * 0.80,
|
||||
child: MaterialButton(
|
||||
@@ -115,7 +116,7 @@ class ProfilePage extends StatelessWidget {
|
||||
},
|
||||
color: Colors.red,
|
||||
child: Text(
|
||||
"Logout".toUpperCase(),
|
||||
"logout".toUpperCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
|
||||
Reference in New Issue
Block a user