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
cbc8ca1e
Commit
cbc8ca1e
authored
Nov 01, 2023
by
Inomjon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call cannection to app
parent
3ee829e6
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
764 additions
and
39 deletions
+764
-39
loading.json
assets/loading.json
+1
-0
user_model.dart
lib/app_models/user_model/user_model.dart
+15
-0
user_sign_up_bloc.dart
lib/blocs/user_sign_up_bloc/user_sign_up_bloc.dart
+4
-5
user_sign_up_event.dart
lib/blocs/user_sign_up_bloc/user_sign_up_event.dart
+6
-1
user_sign_up_state.dart
lib/blocs/user_sign_up_bloc/user_sign_up_state.dart
+20
-2
main.dart
lib/main.dart
+0
-4
app_routes.dart
lib/service/routes/app_routes.dart
+19
-12
routes_name.dart
lib/service/routes/routes_name.dart
+3
-1
app_themes.dart
lib/src/constants/app_themes/app_themes.dart
+9
-3
colors_const.dart
lib/src/constants/colors_const.dart
+6
-0
enter_number_cont.dart
lib/src/controllers/enter_number_cont.dart
+3
-0
app_utils.dart
lib/src/utils/app_utils.dart
+36
-0
show_dialogs.dart
lib/src/utils/show_dialogs.dart
+79
-0
customloading.dart
lib/src/widgets/custom_loading/customloading.dart
+18
-0
app_exeptions.dart
lib/src/widgets/exceptions/app_exeptions.dart
+62
-0
context_extensions.dart
lib/src/widgets/extension/context_extensions.dart
+7
-0
home_page.dart
lib/views/home_view/home_page.dart
+17
-0
main_page.dart
lib/views/main_view/main_page.dart
+57
-0
profile_page.dart
lib/views/profile_view/profile_page.dart
+17
-0
signin_page.dart
lib/views/signin_view/signin_page.dart
+133
-10
signup_page.dart
lib/views/signup_view/signup_page.dart
+216
-0
splash_screen.dart
lib/views/splash_view/splash_screen.dart
+1
-1
users_page.dart
lib/views/users_view/users_page.dart
+17
-0
pubspec.lock
pubspec.lock
+16
-0
pubspec.yaml
pubspec.yaml
+2
-0
No files found.
assets/loading.json
0 → 100644
View file @
cbc8ca1e
This diff is collapsed.
Click to expand it.
lib/app_models/user_model/user_model.dart
0 → 100644
View file @
cbc8ca1e
class
UserModel
{
int
?
id
;
String
?
fullName
;
String
?
email
;
String
?
login
;
UserModel
({
this
.
id
,
this
.
fullName
,
this
.
email
,
this
.
login
});
UserModel
.
fromJson
(
Map
<
dynamic
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
fullName
=
json
[
'full_name'
];
email
=
json
[
'email'
];
login
=
json
[
'login'
];
}
}
\ No newline at end of file
lib/blocs/user_sign_up_bloc/user_sign_up_bloc.dart
View file @
cbc8ca1e
import
'dart:async'
;
import
'package:bloc/bloc.dart'
;
import
'package:equatable/equatable.dart'
;
import
'package:meta/meta.dart'
;
part
'user_sign_up_event.dart'
;
part
'user_sign_up_state.dart'
;
class
UserSignUpBloc
extends
Bloc
<
UserSignUpEvent
,
UserSignUpState
>
{
UserSignUpBloc
()
:
super
(
UserSignUpInitial
())
{
on
<
UserSignUpEvent
>((
event
,
emit
)
{
// TODO: implement event handler
UserSignUpBloc
()
:
super
(
UserSignUpInitial
State
())
{
on
<
UserSignUp
Fetch
Event
>((
event
,
emit
)
{
emit
(
UserSignUpLoadedState
());
});
}
}
lib/blocs/user_sign_up_bloc/user_sign_up_event.dart
View file @
cbc8ca1e
part of
'user_sign_up_bloc.dart'
;
@immutable
abstract
class
UserSignUpEvent
{}
abstract
class
UserSignUpEvent
extends
Equatable
{}
class
UserSignUpFetchEvent
extends
UserSignUpEvent
{
@override
List
<
Object
?>
get
props
=>
[];
}
lib/blocs/user_sign_up_bloc/user_sign_up_state.dart
View file @
cbc8ca1e
part of
'user_sign_up_bloc.dart'
;
@immutable
abstract
class
UserSignUpState
{}
abstract
class
UserSignUpState
extends
Equatable
{}
class
UserSignUpInitial
extends
UserSignUpState
{}
class
UserSignUpInitialState
extends
UserSignUpState
{
@override
List
<
Object
?>
get
props
=>
[];
}
class
UserSignUpFetchState
extends
UserSignUpState
{
@override
List
<
Object
?>
get
props
=>
[];
}
class
UserSignUpLoadedState
extends
UserSignUpState
{
@override
List
<
Object
?>
get
props
=>
[];
}
class
UserSignUpExceptionState
extends
UserSignUpState
{
final
String
message
;
UserSignUpExceptionState
({
required
this
.
message
});
@override
List
<
Object
?>
get
props
=>
[
message
];
}
\ No newline at end of file
lib/main.dart
View file @
cbc8ca1e
...
...
@@ -16,10 +16,6 @@ import 'src/utils/configs.dart' as config;
void
main
(
)
async
{
WidgetsFlutterBinding
.
ensureInitialized
();
SystemChrome
.
setSystemUIOverlayStyle
(
const
SystemUiOverlayStyle
(
statusBarColor:
Colors
.
transparent
,
statusBarIconBrightness:
Brightness
.
light
,
));
await
Firebase
.
initializeApp
(
options:
DefaultFirebaseOptions
.
currentPlatform
);
runApp
(
App
());
}
...
...
lib/service/routes/app_routes.dart
View file @
cbc8ca1e
// ignore_for_file: body_might_complete_normally_nullable
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:vmeeting/blocs/user_sign_up_bloc/user_sign_up_bloc.dart'
;
import
'package:vmeeting/service/routes/routes_name.dart'
;
import
'package:vmeeting/views/
signin_view/sign
in_page.dart'
;
import
'package:vmeeting/views/
main_view/ma
in_page.dart'
;
import
'../../src/controllers/enter_number_cont.dart'
;
import
'../../views/signin_view/signin_page.dart'
;
import
'../../views/signup_view/signup_page.dart'
;
import
'../../views/splash_view/splash_screen.dart'
;
GlobalKey
<
NavigatorState
>
navigatorKey
=
GlobalKey
<
NavigatorState
>();
...
...
@@ -32,19 +36,22 @@ class MainNavigator extends StatelessWidget {
case
MainRoutes
.
splash_screen
:
builder
=
(
BuildContext
_
)
=>
SplashScreen
(
controller:
controller
);
break
;
case
MainRoutes
.
user_signin_page
:
case
MainRoutes
.
main_page
:
builder
=
(
BuildContext
_
)
=>
MainPage
(
controller:
controller
);
break
;
case
MainRoutes
.
sign_in_page
:
builder
=
(
BuildContext
_
)
=>
UserSignInPage
(
controller:
controller
);
break
;
// case MainRoutes.splash_screen
:
//
builder = (BuildContext _) => MultiBlocProvider(
//
providers: [
// BlocProvider<CallPage
Bloc>(
// create: (context) => CallPage
Bloc(),
//
),
//
],
// child: MyMainPage(controller: _controller,
),
//
);
//
break;
case
MainRoutes
.
user_signup_page
:
builder
=
(
BuildContext
_
)
=>
MultiBlocProvider
(
providers:
[
BlocProvider
<
UserSignUp
Bloc
>(
create:
(
context
)
=>
UserSignUp
Bloc
(),
),
],
child:
UserSignUpPage
(
controller:
controller
),
);
break
;
}
if
(
builder
!=
null
)
{
return
MaterialPageRoute
(
builder:
builder
,
settings:
settings
);
...
...
lib/service/routes/routes_name.dart
View file @
cbc8ca1e
...
...
@@ -2,5 +2,7 @@
class
MainRoutes
{
static
const
String
splash_screen
=
"splash_screen"
;
static
const
String
user_signin_page
=
"user_signin_page"
;
static
const
String
user_signup_page
=
"user_signup_page"
;
static
const
String
main_page
=
"main_page"
;
static
const
String
sign_in_page
=
"sign_in_page"
;
}
\ No newline at end of file
lib/src/constants/app_themes/app_themes.dart
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:vmeeting/src/constants/colors_const.dart'
;
ThemeData
getAppTheme
(
BuildContext
context
,
bool
idDark
)
{
SystemChrome
.
setSystemUIOverlayStyle
(
SystemUiOverlayStyle
(
statusBarColor:
Colors
.
transparent
,
statusBarIconBrightness:
idDark
?
Brightness
.
light
:
Brightness
.
dark
,
));
return
ThemeData
(
scaffoldBackgroundColor:
idDark
?
Color
s
.
black
:
Colors
.
white
,
scaffoldBackgroundColor:
idDark
?
Color
Const
.
appMainBackgroundColor
:
ColorConst
.
appSecondWhiteColor
,
textTheme:
GoogleFonts
.
latoTextTheme
(
idDark
?
ThemeData
.
dark
().
textTheme
:
ThemeData
.
light
().
textTheme
),
switchTheme:
SwitchThemeData
(
thumbColor:
MaterialStateProperty
.
all
(
...
...
@@ -12,7 +18,7 @@ import 'package:google_fonts/google_fonts.dart';
listTileTheme:
ListTileThemeData
(
iconColor:
idDark
?
Colors
.
orange
:
Colors
.
purple
),
appBarTheme:
AppBarTheme
(
backgroundColor:
idDark
?
Color
s
.
black
:
Colors
.
white
,
iconTheme:
IconThemeData
(
color:
idDark
?
Color
s
.
white
:
Colors
.
black54
)),
backgroundColor:
idDark
?
Color
Const
.
appMainBackgroundColor
:
ColorConst
.
appSecondWhiteColor
,
iconTheme:
IconThemeData
(
color:
idDark
?
Color
Const
.
appMainBackgroundColor
:
ColorConst
.
appSecondWhiteColor
,
)),
);
}
\ No newline at end of file
lib/src/constants/colors_const.dart
View file @
cbc8ca1e
...
...
@@ -6,6 +6,12 @@ class ColorConst {
static
Color
appBackgroundColor
=
const
Color
(
0xffbec6f4
);
static
Color
appSecondWhiteColor
=
const
Color
(
0xfff1f3f4
);
static
Color
appGreenColor
=
const
Color
(
0xff7bcdd1
);
static
Color
appBleckColor
=
const
Color
(
0xff000000
);
static
Color
appMainBackgroundColor
=
Color
(
0xFF25242a
);
static
Color
appMainColorBak
=
Color
(
0xFF35353f
);
static
Color
appGreanColor
=
Color
(
0xFFb2b7ce
);
static
Color
appRedColor
=
Color
(
0xFFff0000
);
...
...
lib/src/controllers/enter_number_cont.dart
View file @
cbc8ca1e
...
...
@@ -4,5 +4,8 @@ class NumberController {
final
StreamController
<
bool
>
themeController
=
StreamController
<
bool
>.
broadcast
();
Sink
<
bool
>
get
inputTheme
=>
themeController
.
sink
;
Stream
<
bool
>
get
outputTheme
=>
themeController
.
stream
;
final
StreamController
<
bool
>
elevatedButtonController
=
StreamController
<
bool
>.
broadcast
();
Sink
<
bool
>
get
inputElevatedButton
=>
elevatedButtonController
.
sink
;
Stream
<
bool
>
get
outputElevatedButton
=>
elevatedButtonController
.
stream
;
}
lib/src/utils/app_utils.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:vmeeting/src/constants/colors_const.dart'
;
class
AppUtils
{
static
Widget
buttonLoader
=
SizedBox
(
width:
30
,
height:
30
,
child:
CircularProgressIndicator
(
strokeWidth:
3
,
color:
ColorConst
.
appWhiteColor
,
),
);
static
void
showSnackBar
(
BuildContext
context
,
String
message
)
{
final
snackdemo
=
SnackBar
(
content:
Center
(
child:
Text
(
message
,
style:
GoogleFonts
.
lato
(
textStyle:
Theme
.
of
(
context
).
textTheme
.
bodyMedium
,
color:
ColorConst
.
appWhiteColor
,
fontStyle:
FontStyle
.
normal
,),
textAlign:
TextAlign
.
center
,
),),
backgroundColor:
ColorConst
.
appGreenColor
,
elevation:
30
,
behavior:
SnackBarBehavior
.
floating
,
margin:
const
EdgeInsets
.
all
(
50
),
duration:
const
Duration
(
milliseconds:
600
),
shape:
const
StadiumBorder
(),
);
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
snackdemo
);
}
}
lib/src/utils/show_dialogs.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
import
'package:vmeeting/src/extension/context_extensions.dart'
;
import
'../constants/colors_const.dart'
;
import
'../widgets/big_text_widget.dart'
;
import
'../widgets/small_text.dart'
;
void
errorMessage
(
BuildContext
context
)
async
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
MediaQuery
(
data:
MediaQuery
.
of
(
context
).
copyWith
(
textScaleFactor:
1.0
),
child:
Dialog
(
shape:
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
16.0
))),
insetPadding:
const
EdgeInsets
.
only
(
left:
20
,
right:
20
),
backgroundColor:
Colors
.
white
,
child:
StatefulBuilder
(
builder:
(
contex
,
dialogSetState
)
{
return
SizedBox
(
width:
double
.
infinity
,
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
const
SizedBox
(),
InkWell
(
onTap:
()
async
{
Navigator
.
of
(
context
).
pop
(
false
);
},
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
right:
8.0
,
top:
8
),
child:
Icon
(
Icons
.
cancel
,
color:
ColorConst
.
appMainColorBak
),
),
),
],
),
SmallText
(
text:
"There is something wrong with you try again"
,
fontWidget:
FontWeight
.
bold
,
size:
context
.
h
*
0.02
,
textAlign:
TextAlign
.
center
,),
const
SizedBox
(
height:
10
),
const
BigText
(
text:
"❌"
,
size:
60
),
const
SizedBox
(
height:
10
),
Container
(
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
12
),
child:
Column
(
children:
[
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
foregroundColor:
Colors
.
white
,
backgroundColor:
ColorConst
.
appGreenColor
,
disabledForegroundColor:
Colors
.
grey
.
withOpacity
(
0.38
),
disabledBackgroundColor:
Colors
.
grey
.
withOpacity
(
0.12
),
),
onPressed:
()
async
{
Navigator
.
of
(
context
).
pop
(
false
);
},
child:
const
BigText
(
text:
"Ok"
,
fontWidget:
FontWeight
.
bold
,
size:
16
,
)
),
SizedBox
(
height:
context
.
h
*
0.02
),
],),
)
],
),
// child:
);
}),
),
);
});
}
\ No newline at end of file
lib/src/widgets/custom_loading/customloading.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
import
'package:lottie/lottie.dart'
;
// ignore: must_be_immutable
class
CustomLoading
extends
StatelessWidget
{
Color
?
color
;
CustomLoading
({
Key
?
key
,
this
.
color
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
200
,
height:
200
,
alignment:
AlignmentDirectional
.
center
,
child:
Lottie
.
asset
(
'assets/loading.json'
),
);
}
}
\ No newline at end of file
lib/src/widgets/exceptions/app_exeptions.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
import
'package:lottie/lottie.dart'
;
import
'package:vmeeting/src/extension/context_extensions.dart'
;
import
'../../constants/colors_const.dart'
;
import
'../big_text_widget.dart'
;
import
'../small_text.dart'
;
class
AppExceptionsWidget
extends
StatelessWidget
{
final
String
message
;
final
String
authName
;
const
AppExceptionsWidget
({
super
.
key
,
required
this
.
message
,
required
this
.
authName
,
});
@override
Widget
build
(
BuildContext
context
)
{
return
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
width:
200
,
height:
200
,
alignment:
AlignmentDirectional
.
center
,
child:
Lottie
.
asset
(
'assets/internet_error.json'
),
),
const
SizedBox
(
height:
50
),
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
20.0
,
right:
8
),
child:
SmallText
(
text:
message
,
size:
18
,
fontWidget:
FontWeight
.
w600
,
textAlign:
TextAlign
.
center
),
),
const
SizedBox
(
height:
50
),
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
foregroundColor:
Colors
.
white
,
backgroundColor:
ColorConst
.
appBackgroundColor
,
disabledForegroundColor:
Colors
.
grey
.
withOpacity
(
0.38
),
disabledBackgroundColor:
Colors
.
grey
.
withOpacity
(
0.12
),
),
onPressed:
()
{
Navigator
.
of
(
context
).
pushReplacementNamed
(
authName
);
},
child:
SizedBox
(
width:
context
.
w
*
0.8
,
height:
context
.
h
*
0.06
,
child:
Center
(
child:
BigText
(
text:
"Exception"
,
fontWidget:
FontWeight
.
bold
,
color:
ColorConst
.
appWhiteColor
,
size:
16
,
),
),
),
),
],
);
}
}
lib/src/widgets/extension/context_extensions.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
extension
HeightWidthContext
on
BuildContext
{
MediaQueryData
get
mq
=>
MediaQuery
.
of
(
this
);
double
get
h
=>
mq
.
size
.
height
;
double
get
w
=>
mq
.
size
.
width
;
}
\ No newline at end of file
lib/views/home_view/home_page.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
import
'package:vmeeting/src/constants/colors_const.dart'
;
import
'package:vmeeting/src/widgets/big_text_widget.dart'
;
import
'../../src/controllers/enter_number_cont.dart'
;
class
HomePage
extends
StatelessWidget
{
final
NumberController
controller
;
const
HomePage
({
super
.
key
,
required
this
.
controller
});
@override
Widget
build
(
BuildContext
context
)
{
return
Center
(
child:
BigText
(
text:
"Salom"
,
color:
ColorConst
.
appMainBackgroundColor
,)
);
}
}
\ No newline at end of file
lib/views/main_view/main_page.dart
0 → 100644
View file @
cbc8ca1e
import
'package:curved_navigation_bar/curved_navigation_bar.dart'
;
import
'package:flutter/material.dart'
;
import
'package:vmeeting/src/controllers/enter_number_cont.dart'
;
import
'package:vmeeting/views/home_view/home_page.dart'
;
import
'package:vmeeting/views/profile_view/profile_page.dart'
;
import
'package:vmeeting/views/users_view/users_page.dart'
;
import
'../../src/constants/colors_const.dart'
;
class
MainPage
extends
StatefulWidget
{
final
NumberController
controller
;
const
MainPage
({
super
.
key
,
required
this
.
controller
});
@override
State
<
MainPage
>
createState
()
=>
_MainPageState
();
}
class
_MainPageState
extends
State
<
MainPage
>
{
int
current_index
=
0
;
late
List
<
Widget
>
pages
=
[
HomePage
(
controller:
widget
.
controller
),
AllUsersViewPage
(
controller:
widget
.
controller
),
ProfilePage
(
controller:
widget
.
controller
)
];
void
OnTapped
(
int
index
)
{
setState
(()
{
current_index
=
index
;
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
bottomNavigationBar:
Container
(
height:
80
,
padding:
const
EdgeInsets
.
all
(
8
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
50
),
child:
CurvedNavigationBar
(
height:
50
,
backgroundColor:
ColorConst
.
appGreanColor
,
color:
ColorConst
.
appGreenColor
,
buttonBackgroundColor:
ColorConst
.
appGreenColor
,
onTap:
OnTapped
,
items:
const
<
Widget
>[
Icon
(
Icons
.
home
),
Icon
(
Icons
.
search
),
Icon
(
Icons
.
person
)
],
),
),
),
body:
pages
[
current_index
],
);
}
}
lib/views/profile_view/profile_page.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
import
'../../src/controllers/enter_number_cont.dart'
;
class
ProfilePage
extends
StatelessWidget
{
final
NumberController
controller
;
const
ProfilePage
({
super
.
key
,
required
this
.
controller
});
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Center
(
child:
Text
(
"Profil Page"
),
),
);
}
}
\ No newline at end of file
lib/views/signin_view/signin_page.dart
View file @
cbc8ca1e
import
'package:connectycube_sdk/connectycube_calls.dart'
;
import
'package:flutter/material.dart'
;
import
'package:vmeeting/src/controllers/enter_number_cont.dart'
;
import
'package:vmeeting/src/extension/context_extensions.dart'
;
import
'../../app_models/user_model/user_model.dart'
;
import
'../../service/routes/routes_name.dart'
;
import
'../../src/constants/colors_const.dart'
;
import
'../../src/utils/app_utils.dart'
;
import
'../../src/utils/show_dialogs.dart'
;
import
'../../src/widgets/big_text_widget.dart'
;
import
'../../src/widgets/custom_loading/customloading.dart'
;
import
'../../src/widgets/textfiled_widgets/auth_text_fild.dart'
;
class
UserSignInPage
extends
StatefulWidget
{
final
NumberController
controller
;
...
...
@@ -10,20 +21,132 @@ class UserSignInPage extends StatefulWidget {
}
class
_UserSignInPageState
extends
State
<
UserSignInPage
>
{
late
bool
isDarkMode
=
false
;
final
_loginControlle
=
TextEditingController
(
text:
""
);
final
_loginFocusNode
=
FocusNode
();
final
_passwordControlle
=
TextEditingController
(
text:
""
);
final
_passwordFocusNode
=
FocusNode
();
late
bool
theme
=
false
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Center
(
child:
Switch
(
value:
theme
,
onChanged:
(
val
){
theme
=
val
;
widget
.
controller
.
inputTheme
.
add
(
val
);
},
),
),
body:
buildUI
(),
);
}
Widget
buildUI
(){
return
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
context
.
w
*
0.06
),
child:
SingleChildScrollView
(
child:
Column
(
children:
[
SizedBox
(
height:
context
.
h
*
0.06
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
Switch
.
adaptive
(
value:
isDarkMode
,
activeColor:
ColorConst
.
appGreenColor
,
onChanged:
(
value
)
{
isDarkMode
=
value
;
widget
.
controller
.
inputTheme
.
add
(
value
);
},
),
],),
SizedBox
(
height:
context
.
h
*
0.12
),
BigText
(
text:
"Sign In"
,
size:
context
.
h
*
0.04
,
fontWidget:
FontWeight
.
bold
,
),
SizedBox
(
height:
context
.
h
*
0.1
),
AuthTextFild
(
lableName:
"Login"
,
borderRadius:
10
,
elevation:
1
,
color:
Colors
.
grey
.
withOpacity
(
0.2
),
focusNode:
_loginFocusNode
,
textEditingController:
_loginControlle
,
),
SizedBox
(
height:
context
.
h
*
0.03
),
AuthTextFild
(
lableName:
"Password"
,
borderRadius:
10
,
elevation:
1
,
color:
Colors
.
grey
.
withOpacity
(
0.2
),
focusNode:
_passwordFocusNode
,
textEditingController:
_passwordControlle
,
),
SizedBox
(
height:
context
.
h
*
0.16
),
buildButtons
(),
],
),
)
);
}
Widget
buildButtons
()
{
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
,
disabledForegroundColor:
Colors
.
grey
.
withOpacity
(
0.38
),
disabledBackgroundColor:
Colors
.
grey
.
withOpacity
(
0.12
),
),
onPressed:
()
async
{
if
(
_loginControlle
.
text
.
isNotEmpty
&&
_passwordControlle
.
text
.
isNotEmpty
){
widget
.
controller
.
inputElevatedButton
.
add
(
true
);
userSigIn
();
}
else
{
AppUtils
.
showSnackBar
(
context
,
"PLEASE ENTER THE SAME VALUE AGAIN"
);
}
},
child:
SizedBox
(
width:
context
.
w
*
0.8
,
height:
context
.
h
*
0.06
,
child:
Center
(
child:
snapshot
.
data
??
false
?
AppUtils
.
buttonLoader
:
const
BigText
(
text:
"Sin Up"
,
fontWidget:
FontWeight
.
bold
,
size:
16
,
),
),
),
),
],
);
});
}
Future
<
void
>
userSigIn
()
async
{
CubeUser
user
=
CubeUser
(
login:
_loginControlle
.
text
,
password:
_passwordControlle
.
text
,);
signIn
(
user
).
then
((
cubeUser
)
{
UserModel
(
id:
cubeUser
.
id
,
login:
cubeUser
.
login
,
email:
cubeUser
.
email
,
fullName:
cubeUser
.
fullName
);
print
(
"Shu yerda
$cubeUser
"
);
widget
.
controller
.
inputElevatedButton
.
add
(
false
);
Navigator
.
pushReplacementNamed
(
context
,
MainRoutes
.
main_page
);
})
.
catchError
((
error
){
widget
.
controller
.
inputElevatedButton
.
add
(
false
);
errorMessage
(
context
);
print
(
error
);
});
}
Widget
buildLoading
()
{
return
Center
(
child:
CustomLoading
());
}
}
lib/views/signup_view/signup_page.dart
0 → 100644
View file @
cbc8ca1e
import
'package:connectycube_sdk/connectycube_chat.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:vmeeting/blocs/user_sign_up_bloc/user_sign_up_bloc.dart'
;
import
'package:vmeeting/src/controllers/enter_number_cont.dart'
;
import
'package:vmeeting/src/extension/context_extensions.dart'
;
import
'package:vmeeting/src/utils/app_utils.dart'
;
import
'../../app_models/user_model/user_model.dart'
;
import
'../../service/routes/routes_name.dart'
;
import
'../../src/constants/colors_const.dart'
;
import
'../../src/utils/show_dialogs.dart'
;
import
'../../src/widgets/big_text_widget.dart'
;
import
'../../src/widgets/custom_loading/customloading.dart'
;
import
'../../src/widgets/exceptions/app_exeptions.dart'
;
import
'../../src/widgets/textfiled_widgets/auth_text_fild.dart'
;
class
UserSignUpPage
extends
StatefulWidget
{
final
NumberController
controller
;
const
UserSignUpPage
({
super
.
key
,
required
this
.
controller
});
@override
State
<
UserSignUpPage
>
createState
()
=>
_UserSignUpPageState
();
}
class
_UserSignUpPageState
extends
State
<
UserSignUpPage
>
{
late
UserSignUpBloc
userSignUpBloc
;
late
bool
isDarkMode
=
false
;
final
_loginControlle
=
TextEditingController
(
text:
"Flutter2000"
);
final
_loginFocusNode
=
FocusNode
();
final
_passwordControlle
=
TextEditingController
(
text:
"Flutter2000"
);
final
_passwordFocusNode
=
FocusNode
();
final
_emailControlle
=
TextEditingController
(
text:
"muxtorovinomjon0227@gmail.com"
);
final
_emailFocusNode
=
FocusNode
();
final
_fullNameControlle
=
TextEditingController
(
text:
"Muxtorov Inomjon"
);
final
_fullNameFocusNode
=
FocusNode
();
@override
void
initState
()
{
userSignUpBloc
=
BlocProvider
.
of
<
UserSignUpBloc
>(
context
);
userSignUpBloc
.
add
(
UserSignUpFetchEvent
());
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
BlocConsumer
<
UserSignUpBloc
,
UserSignUpState
>(
listener:
(
context
,
state
)
{},
builder:
(
context
,
state
)
{
if
(
state
is
UserSignUpInitialState
)
{
return
buildLoading
();
}
if
(
state
is
UserSignUpLoadedState
)
{
return
buildUI
();
}
if
(
state
is
UserSignUpFetchState
)
{
return
const
Center
(
child:
AppExceptionsWidget
(
message:
"Exception"
,
authName:
MainRoutes
.
user_signup_page
));
}
if
(
state
is
UserSignUpExceptionState
)
{
return
const
Center
(
child:
AppExceptionsWidget
(
message:
"Exception"
,
authName:
MainRoutes
.
user_signup_page
));
}
return
const
Center
(
child:
Text
(
"AloVoice"
));
},
),
);
}
Widget
buildUI
(){
return
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
context
.
w
*
0.06
),
child:
SingleChildScrollView
(
child:
Column
(
children:
[
SizedBox
(
height:
context
.
h
*
0.06
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
Switch
.
adaptive
(
value:
isDarkMode
,
activeColor:
ColorConst
.
appGreenColor
,
onChanged:
(
value
)
{
isDarkMode
=
value
;
widget
.
controller
.
inputTheme
.
add
(
value
);
},
),
],),
SizedBox
(
height:
context
.
h
*
0.1
),
BigText
(
text:
"Sign Up"
,
size:
context
.
h
*
0.04
,
fontWidget:
FontWeight
.
bold
,
),
SizedBox
(
height:
context
.
h
*
0.1
),
AuthTextFild
(
lableName:
"Email"
,
borderRadius:
10
,
elevation:
1
,
color:
Colors
.
grey
.
withOpacity
(
0.2
),
type:
TextInputType
.
emailAddress
,
focusNode:
_emailFocusNode
,
textEditingController:
_emailControlle
,
),
SizedBox
(
height:
context
.
h
*
0.03
),
AuthTextFild
(
lableName:
"Login"
,
borderRadius:
10
,
elevation:
1
,
color:
Colors
.
grey
.
withOpacity
(
0.2
),
focusNode:
_loginFocusNode
,
textEditingController:
_loginControlle
,
),
SizedBox
(
height:
context
.
h
*
0.03
),
AuthTextFild
(
lableName:
"Password"
,
borderRadius:
10
,
elevation:
1
,
color:
Colors
.
grey
.
withOpacity
(
0.2
),
focusNode:
_passwordFocusNode
,
textEditingController:
_passwordControlle
,
),
SizedBox
(
height:
context
.
h
*
0.03
),
AuthTextFild
(
lableName:
"FullName"
,
borderRadius:
10
,
elevation:
1
,
color:
Colors
.
grey
.
withOpacity
(
0.2
),
focusNode:
_fullNameFocusNode
,
textEditingController:
_fullNameControlle
,
),
SizedBox
(
height:
context
.
h
*
0.06
),
SizedBox
(
height:
context
.
h
*
0.06
),
buildButtons
(),
],
),
)
);
}
Widget
buildButtons
()
{
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
,
disabledForegroundColor:
Colors
.
grey
.
withOpacity
(
0.38
),
disabledBackgroundColor:
Colors
.
grey
.
withOpacity
(
0.12
),
),
onPressed:
()
async
{
Navigator
.
pushReplacementNamed
(
context
,
MainRoutes
.
main_page
);
if
(
_fullNameControlle
.
text
.
isNotEmpty
&&
_emailControlle
.
text
.
isNotEmpty
&&
_loginControlle
.
text
.
isNotEmpty
&&
_passwordControlle
.
text
.
isNotEmpty
){
widget
.
controller
.
inputElevatedButton
.
add
(
true
);
userSigUp
();
}
else
{
AppUtils
.
showSnackBar
(
context
,
"PLEASE ENTER THE SAME VALUE AGAIN"
);
}
},
child:
SizedBox
(
width:
context
.
w
*
0.8
,
height:
context
.
h
*
0.06
,
child:
Center
(
child:
snapshot
.
data
??
false
?
AppUtils
.
buttonLoader
:
const
BigText
(
text:
"Sin Up"
,
fontWidget:
FontWeight
.
bold
,
size:
16
,
),
),
),
),
],
);
});
}
Future
<
void
>
userSigUp
()
async
{
CubeUser
user
=
CubeUser
(
login:
_loginControlle
.
text
,
password:
_passwordControlle
.
text
,
email:
_emailControlle
.
text
,
fullName:
_fullNameControlle
.
text
,);
signUp
(
user
).
then
((
cubeUser
)
{
UserModel
(
id:
cubeUser
.
id
,
login:
cubeUser
.
login
,
email:
cubeUser
.
email
,
fullName:
cubeUser
.
fullName
);
print
(
"Shu yerda
$cubeUser
"
);
widget
.
controller
.
inputElevatedButton
.
add
(
false
);
})
.
catchError
((
error
){
widget
.
controller
.
inputElevatedButton
.
add
(
false
);
errorMessage
(
context
);
print
(
error
);
});
}
Widget
buildLoading
()
{
return
Center
(
child:
CustomLoading
());
}
}
lib/views/splash_view/splash_screen.dart
View file @
cbc8ca1e
...
...
@@ -30,7 +30,7 @@ class _SplashScreenState extends State<SplashScreen>
..
forward
()
..
addStatusListener
((
status
)
async
{
if
(
status
==
AnimationStatus
.
completed
)
{
Navigator
.
of
(
context
).
pushReplacementNamed
(
MainRoutes
.
user_sign
in_page
);
Navigator
.
of
(
context
).
pushReplacementNamed
(
MainRoutes
.
sign_
in_page
);
}
});
_curvedAnimation
=
...
...
lib/views/users_view/users_page.dart
0 → 100644
View file @
cbc8ca1e
import
'package:flutter/material.dart'
;
import
'../../src/controllers/enter_number_cont.dart'
;
class
AllUsersViewPage
extends
StatelessWidget
{
final
NumberController
controller
;
const
AllUsersViewPage
({
super
.
key
,
required
this
.
controller
});
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
body:
Center
(
child:
Text
(
"Users Page"
),
),
);
}
}
pubspec.lock
View file @
cbc8ca1e
...
...
@@ -129,6 +129,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.6"
curved_navigation_bar:
dependency: "direct main"
description:
name: curved_navigation_bar
sha256: ea6412d00c5d83501bbf1cf9d1ac2ff11a20fbaf910c103c95ace7de82910334
url: "https://pub.dev"
source: hosted
version: "1.0.3"
dart_webrtc:
dependency: transitive
description:
...
...
@@ -328,6 +336,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
lottie:
dependency: "direct main"
description:
name: lottie
sha256: a93542cc2d60a7057255405f62252533f8e8956e7e06754955669fd32fb4b216
url: "https://pub.dev"
source: hosted
version: "2.7.0"
matcher:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
cbc8ca1e
...
...
@@ -49,6 +49,8 @@ dependencies:
upgrader
:
^8.1.0
flutter_bloc
:
^8.1.3
equatable
:
^2.0.5
lottie
:
^2.4.0
curved_navigation_bar
:
^1.0.3
dev_dependencies
:
flutter_test
:
...
...
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