Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vmeeting
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Inomjon
vmeeting
Commits
63db43d2
Commit
63db43d2
authored
Nov 08, 2023
by
Inomjon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Aplication webga chiqdi
parent
dac0c905
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
49 deletions
+80
-49
edit_profile_bloc.dart
lib/blocs/edit_profile_bloc/edit_profile_bloc.dart
+4
-1
edit_profile_event.dart
lib/blocs/edit_profile_bloc/edit_profile_event.dart
+3
-1
user_repo.dart
lib/service/user_repositores/user_repo.dart
+4
-3
drower_menue.dart
lib/views/drower_view/drower_menue.dart
+2
-3
edit_profile_page.dart
lib/views/edit_profile_view/edit_profile_page.dart
+47
-33
profile_page.dart
lib/views/profile_view/profile_page.dart
+20
-8
No files found.
lib/blocs/edit_profile_bloc/edit_profile_bloc.dart
View file @
63db43d2
...
...
@@ -2,8 +2,10 @@
import
'package:bloc/bloc.dart'
;
import
'package:connectycube_sdk/connectycube_calls.dart'
;
import
'package:equatable/equatable.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:meta/meta.dart'
;
import
'package:vmeeting/service/user_repositores/user_repo.dart'
;
import
'package:vmeeting/src/controllers/enter_number_cont.dart'
;
import
'../../src/utils/app_utils.dart'
;
part
'edit_profile_event.dart'
;
part
'edit_profile_state.dart'
;
...
...
@@ -16,7 +18,8 @@ class EditProfileBloc extends Bloc<EditProfileEvent, EditProfileState> {
on
<
EditProfileUpdateEvent
>((
event
,
emit
)
async
{
try
{
await
UserRepository
.
getInstance
().
updateUserProfile
(
event
.
user
??
CubeUser
());
await
UserRepository
.
getInstance
().
updateUserProfile
(
event
.
context
,
event
.
user
??
CubeUser
());
event
.
controller
?.
inputElevatedButton
.
add
(
false
);
emit
(
EditProfileLoadedState
(
user:
AppUtils
.
cubeUser
));
}
catch
(
e
){
emit
(
EditProfileExceptionState
(
message:
e
.
toString
()));
...
...
lib/blocs/edit_profile_bloc/edit_profile_event.dart
View file @
63db43d2
...
...
@@ -9,8 +9,10 @@ class EditProfileFetchEvent extends EditProfileEvent{
}
class
EditProfileUpdateEvent
extends
EditProfileEvent
{
final
BuildContext
context
;
final
NumberController
?
controller
;
final
CubeUser
?
user
;
EditProfileUpdateEvent
({
this
.
user
});
EditProfileUpdateEvent
({
required
this
.
context
,
this
.
controller
,
this
.
user
});
@override
List
<
Object
?>
get
props
=>
[
user
];
}
lib/service/user_repositores/user_repo.dart
View file @
63db43d2
...
...
@@ -145,8 +145,8 @@ class UserRepository {
});
}
Future
<
void
>
updateUserProfile
(
CubeUser
user
)
async
{
updateUser
(
user
).
then
((
updatedUser
)
{
Future
<
void
>
updateUserProfile
(
BuildContext
context
,
CubeUser
user
)
async
{
await
updateUser
(
user
).
then
((
updatedUser
)
{
AppUtils
.
cubeUser
=
updatedUser
;
AppUtils
.
userModel
=
UserModel
(
login:
updatedUser
.
login
??
""
,
...
...
@@ -166,8 +166,9 @@ class UserRepository {
timezone:
updatedUser
.
timeZone
.
toString
(),
twitterId:
updatedUser
.
twitterId
??
""
,
updatedAt:
updatedUser
.
updatedAt
?.
toIso8601String
()
??
""
,
website:
updatedUser
.
website
.
toString
()
??
""
website:
updatedUser
.
website
.
toString
()
,
);
AppUtils
.
showSnackBar
(
context
,
"The profile has been updated ✅"
);
}).
catchError
((
error
)
{});
}
...
...
lib/views/drower_view/drower_menue.dart
View file @
63db43d2
import
'package:connectycube_sdk/connectycube_chat.dart'
;
import
'package:connectycube_sdk/connectycube_sdk.dart'
;
import
'package:flutter/material.dart'
;
import
'package:vmeeting/src/extension/context_extensions.dart'
;
...
...
@@ -73,8 +72,8 @@ class _DrawerMenueState extends State<DrawerMenue> {
child:
Column
(
children:
[
ListTile
(
leading:
Icon
(
Icons
.
settings
,
color:
ColorConst
.
appBleckColor
),
title:
const
BigText
(
text:
"Settings"
,
),
leading:
Icon
(
Icons
.
lock
,
color:
ColorConst
.
appBleckColor
),
title:
const
SmallText
(
text:
"Password changed"
,
size:
16
),
trailing:
Icon
(
Icons
.
navigate_next
,
color:
ColorConst
.
appBleckColor
,
size:
30
,
...
...
lib/views/edit_profile_view/edit_profile_page.dart
View file @
63db43d2
...
...
@@ -141,8 +141,14 @@ class _EditProfilePageState extends State<EditProfilePage> {
],);
}
Widget
buildButtons
(
BuildContext
context
,
CubeUser
cubeUser
)
{
return
ElevatedButton
(
return
StreamBuilder
(
stream:
widget
.
controller
.
outputElevatedButton
,
builder:
(
BuildContext
context
,
snapshot
){
return
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
foregroundColor:
Colors
.
white
,
backgroundColor:
ColorConst
.
appGreenColor
,
...
...
@@ -151,14 +157,16 @@ class _EditProfilePageState extends State<EditProfilePage> {
),
onPressed:
()
async
{
if
(
_loginControlle
.
text
.
isNotEmpty
&&
_emailControlle
.
text
.
isNotEmpty
&&
_fullNameControlle
.
text
.
isNotEmpty
){
widget
.
controller
.
inputElevatedButton
.
add
(
true
);
editProfileBloc
.
add
(
EditProfileUpdateEvent
(
controller:
widget
.
controller
,
user:
CubeUser
(
fullName:
_fullNameControlle
.
text
,
email:
_emailControlle
.
text
,
login:
_loginControlle
.
text
,
phone:
_phoneControlle
.
text
,
id:
cubeUser
.
id
,
)
),
context:
context
));
}
else
{
AppUtils
.
showSnackBar
(
context
,
"PLEASE ENTER THE SAME VALUE AGAIN"
);
...
...
@@ -168,16 +176,22 @@ class _EditProfilePageState extends State<EditProfilePage> {
child:
SizedBox
(
height:
context
.
h
*
0.06
,
child:
Center
(
child:
BigText
(
child:
snapshot
.
data
??
false
?
AppUtils
.
buttonLoader
:
BigText
(
text:
"Update"
.
toUpperCase
(),
fontWidget:
FontWeight
.
bold
,
size:
16
,
),
),
),
),
],
);
});
}
Widget
buildImage
(
BuildContext
context
,
CubeUser
cubeUser
)
{
return
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
...
...
lib/views/profile_view/profile_page.dart
View file @
63db43d2
...
...
@@ -47,11 +47,11 @@ class ProfilePage extends StatelessWidget {
borderRadius:
BorderRadius
.
circular
(
12
)),
child:
Center
(
child:
SmallText
(
text:
AppUtils
.
userModel
.
id
.
toString
()
??
"
"
,
text:
"ID:
${AppUtils.userModel.id ?? ""}
"
,
),
),
),
SizedBox
(
height:
context
.
h
*
0.0
3
),
SizedBox
(
height:
context
.
h
*
0.0
2
),
Container
(
height:
context
.
h
*
0.06
,
decoration:
BoxDecoration
(
...
...
@@ -59,11 +59,11 @@ class ProfilePage extends StatelessWidget {
borderRadius:
BorderRadius
.
circular
(
12
)),
child:
Center
(
child:
SmallText
(
text:
AppUtils
.
userModel
.
fullName
??
"
"
,
text:
"Full Name:
${AppUtils.userModel.fullName ?? ""}
"
,
),
),
),
SizedBox
(
height:
context
.
h
*
0.0
3
),
SizedBox
(
height:
context
.
h
*
0.0
2
),
Container
(
height:
context
.
h
*
0.06
,
decoration:
BoxDecoration
(
...
...
@@ -71,11 +71,11 @@ class ProfilePage extends StatelessWidget {
borderRadius:
BorderRadius
.
circular
(
12
)),
child:
Center
(
child:
SmallText
(
text:
AppUtils
.
userModel
.
email
??
"
"
,
text:
"Emile:
${AppUtils.userModel.email ?? " "}
"
,
),
),
),
SizedBox
(
height:
context
.
h
*
0.0
3
),
SizedBox
(
height:
context
.
h
*
0.0
2
),
Container
(
height:
context
.
h
*
0.06
,
decoration:
BoxDecoration
(
...
...
@@ -83,11 +83,23 @@ class ProfilePage extends StatelessWidget {
borderRadius:
BorderRadius
.
circular
(
12
)),
child:
Center
(
child:
SmallText
(
text:
result
.
toString
()
,
text:
"Phone:
${AppUtils.userModel.phone ?? "No phone"}
"
,
),
),
),
SizedBox
(
height:
context
.
h
*
0.1
),
SizedBox
(
height:
context
.
h
*
0.02
),
Container
(
height:
context
.
h
*
0.06
,
decoration:
BoxDecoration
(
color:
ColorConst
.
appBackgroundColor
,
borderRadius:
BorderRadius
.
circular
(
12
)),
child:
Center
(
child:
SmallText
(
text:
"Create Date:
$result
"
,
),
),
),
SizedBox
(
height:
context
.
h
*
0.05
),
buildButtons
(
context
),
],
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment