Commit 220563f2 authored by Inomjon's avatar Inomjon

Call cannection to app

parent 7783cb5b
import 'dart:async';
import 'package:bloc/bloc.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
});
}
}
part of 'user_sign_up_bloc.dart';
@immutable
abstract class UserSignUpEvent {}
part of 'user_sign_up_bloc.dart';
@immutable
abstract class UserSignUpState {}
class UserSignUpInitial extends UserSignUpState {}
...@@ -8,6 +8,8 @@ import 'package:google_fonts/google_fonts.dart'; ...@@ -8,6 +8,8 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:upgrader/upgrader.dart'; import 'package:upgrader/upgrader.dart';
import 'package:vmeeting/service/routes/app_routes.dart'; import 'package:vmeeting/service/routes/app_routes.dart';
import 'package:vmeeting/service/routes/navigator_service.dart'; import 'package:vmeeting/service/routes/navigator_service.dart';
import 'package:vmeeting/src/constants/app_themes/app_themes.dart';
import 'package:vmeeting/src/controllers/enter_number_cont.dart';
import 'package:vmeeting/src/utils/pref_util.dart'; import 'package:vmeeting/src/utils/pref_util.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
import 'src/utils/configs.dart' as config; import 'src/utils/configs.dart' as config;
...@@ -33,14 +35,17 @@ class App extends StatefulWidget { ...@@ -33,14 +35,17 @@ class App extends StatefulWidget {
} }
class _AppState extends State<App> { class _AppState extends State<App> {
final NumberController controller = NumberController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return StreamBuilder(
stream: controller.outputTheme,
initialData: false,
builder: (BuildContext context, snapshot){
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
theme: ThemeData( theme: getAppTheme(context, snapshot.data ?? false),
textTheme: GoogleFonts.latoTextTheme(),
),
title: 'Theme App', title: 'Theme App',
navigatorKey: App.navigationService.navigatorKey, navigatorKey: App.navigationService.navigatorKey,
home: UpgradeAlert( home: UpgradeAlert(
...@@ -55,9 +60,10 @@ class _AppState extends State<App> { ...@@ -55,9 +60,10 @@ class _AppState extends State<App> {
durationUntilAlertAgain: const Duration(days: 1), durationUntilAlertAgain: const Duration(days: 1),
dialogStyle: Platform.isIOS ? UpgradeDialogStyle.cupertino : UpgradeDialogStyle.material dialogStyle: Platform.isIOS ? UpgradeDialogStyle.cupertino : UpgradeDialogStyle.material
), ),
child: const MainNavigator(), child: MainNavigator(controller: controller),
) )
); );
});
} }
@override @override
......
...@@ -2,15 +2,16 @@ ...@@ -2,15 +2,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:vmeeting/service/routes/routes_name.dart'; import 'package:vmeeting/service/routes/routes_name.dart';
import 'package:vmeeting/views/signin_view/signin_page.dart';
import '../../src/controllers/enter_number_cont.dart'; import '../../src/controllers/enter_number_cont.dart';
import '../../views/splash_view/splash_screen.dart'; import '../../views/splash_view/splash_screen.dart';
GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
final NumberController _controller = NumberController();
class MainNavigator extends StatelessWidget { class MainNavigator extends StatelessWidget {
const MainNavigator({Key? key}) : super(key: key); final NumberController controller;
const MainNavigator({Key? key, required this.controller}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -29,7 +30,10 @@ class MainNavigator extends StatelessWidget { ...@@ -29,7 +30,10 @@ class MainNavigator extends StatelessWidget {
WidgetBuilder? builder; WidgetBuilder? builder;
switch (settings.name) { switch (settings.name) {
case MainRoutes.splash_screen: case MainRoutes.splash_screen:
builder = (BuildContext _) => SplashScreen(controller: _controller,); builder = (BuildContext _) => SplashScreen(controller: controller);
break;
case MainRoutes.user_signin_page:
builder = (BuildContext _) => UserSignInPage(controller: controller);
break; break;
// case MainRoutes.splash_screen: // case MainRoutes.splash_screen:
// builder = (BuildContext _) => MultiBlocProvider( // builder = (BuildContext _) => MultiBlocProvider(
......
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
class MainRoutes { class MainRoutes {
static const String splash_screen = "splash_screen"; static const String splash_screen = "splash_screen";
static const String user_signin_page = "user_signin_page";
} }
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
ThemeData getAppTheme(BuildContext context, bool idDark) {
return ThemeData(
scaffoldBackgroundColor: idDark ? Colors.black : Colors.white,
textTheme: GoogleFonts.latoTextTheme(idDark ? ThemeData.dark().textTheme : ThemeData.light().textTheme),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.all(
idDark ? Colors.orange : Colors.purple),
),
listTileTheme: ListTileThemeData(
iconColor: idDark ? Colors.orange : Colors.purple),
appBarTheme: AppBarTheme(
backgroundColor: idDark ? Colors.black : Colors.white,
iconTheme: IconThemeData(color: idDark ? Colors.white : Colors.black54)),
);
}
\ No newline at end of file
import 'dart:async'; import 'dart:async';
class NumberController { class NumberController {
final StreamController<int> controller = StreamController<int>.broadcast(); final StreamController<bool> themeController = StreamController<bool>.broadcast();
Sink<int> get inputNumber => controller.sink; Sink<bool> get inputTheme => themeController.sink;
Stream<int> get outputNumber => controller.stream; Stream<bool> get outputTheme => themeController.stream;
} }
import 'dart:convert'; import 'dart:convert';
import 'package:connectycube_flutter_call_kit/connectycube_flutter_call_kit.dart'; import 'package:connectycube_flutter_call_kit/connectycube_flutter_call_kit.dart';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import 'package:universal_io/io.dart'; import 'package:universal_io/io.dart';
import 'package:connectycube_sdk/connectycube_sdk.dart'; import 'package:connectycube_sdk/connectycube_sdk.dart';
import '../../main.dart';
import '../../../main.dart';
import '../utils/consts.dart'; import '../utils/consts.dart';
import '../utils/pref_util.dart'; import '../utils/pref_util.dart';
...@@ -136,6 +131,7 @@ Future<void> onCallRejectedWhenTerminated(CallEvent callEvent) async { ...@@ -136,6 +131,7 @@ Future<void> onCallRejectedWhenTerminated(CallEvent callEvent) async {
var currentUser = await SharedPrefs.getUser(); var currentUser = await SharedPrefs.getUser();
initConnectycubeContextLess(); initConnectycubeContextLess();
var sendOfflineReject = rejectCall(callEvent.sessionId, { var sendOfflineReject = rejectCall(callEvent.sessionId, {
...callEvent.opponentsIds.where((userId) => currentUser!.id != userId), ...callEvent.opponentsIds.where((userId) => currentUser!.id != userId),
callEvent.callerId callEvent.callerId
......
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:vmeeting/src/extension/context_extensions.dart';
import 'package:vmeeting/src/widgets/textfiled_widgets/text_filed_wrapper.dart';
class AuthTextFild extends StatelessWidget {
final String lableName;
final double borderRadius;
final Icon? icon;
final Widget? suffixIcon;
final double elevation;
final Color color;
final TextInputType? type;
final bool obscureText;
final FocusNode focusNode;
final TextEditingController textEditingController;
final dynamic Function(String?)? callback;
const AuthTextFild(
{Key? key,
required this.lableName,
this.borderRadius = 16,
this.icon,
this.suffixIcon,
this.elevation = 10,
this.color = Colors.white,
this.type,
this.obscureText = false,
required this.focusNode,
required this.textEditingController,
this.callback,
})
: super(key: key);
@override
Widget build(BuildContext context) {
return _buildSearchBar(context);
}
Widget _buildSearchBar(BuildContext context) {
return Column(children: [
Material(
elevation: elevation,
borderRadius: BorderRadius.circular(borderRadius),
shadowColor: const Color(0xffffffff),
child: Container(
padding: const EdgeInsets.only(),
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
),
child: FocusScope(
child: Focus(
onFocusChange: (focus) {},
child: TextFieldWrapper(
focusNode: focusNode,
label: lableName,
color: color,
borderRadius: borderRadius,
child: TextFormField(
keyboardType: type,
obscureText: obscureText,
controller: textEditingController,
focusNode: focusNode,
enabled: true,
onChanged: callback,
onFieldSubmitted: (value) {},
style: GoogleFonts.lato(
textStyle: Theme.of(context).textTheme.bodyMedium,
fontStyle: FontStyle.normal,
color: Colors.black,
),
textAlign: TextAlign.start,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(context.h*0.02),
prefixIcon: icon,
suffixIcon: suffixIcon,
hintText: lableName,
hintStyle: GoogleFonts.lato(
textStyle: Theme.of(context).textTheme.bodyMedium,
fontStyle: FontStyle.normal,
color: Colors.grey,
),
counterStyle: GoogleFonts.lato(
textStyle: Theme.of(context).textTheme.bodyMedium,
fontStyle: FontStyle.normal,
color: Colors.grey,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(borderRadius),
),
),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.white),
borderRadius: BorderRadius.circular(borderRadius),
),
enabledBorder: UnderlineInputBorder(
borderSide: const BorderSide(color: Colors.white),
borderRadius: BorderRadius.circular(borderRadius),
),
),
),
),
),
),
),
),
]);
}
}
import 'package:flutter/material.dart';
class TextFieldWrapper extends StatefulWidget {
final String label;
final TextFormField child;
final FocusNode focusNode;
final Color color;
final double borderRadius;
const TextFieldWrapper({
Key? key,
required this.label,
required this.child,
required this.focusNode,
required this.color,
required this.borderRadius,
}) : super(key: key);
@override
// ignore: library_private_types_in_public_api
_TextFieldWrapperState createState() => _TextFieldWrapperState();
}
class _TextFieldWrapperState extends State<TextFieldWrapper> {
@override
void initState() {
super.initState();
widget.focusNode.addListener(() {
if (mounted) {
setState(() {});
}
});
}
@override
Widget build(BuildContext context) {
var decorationTheme = Theme.of(context).inputDecorationTheme;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Material(
color: widget.color,
borderRadius: BorderRadius.circular(widget.borderRadius),
child: Theme(
data: Theme.of(context).copyWith(
inputDecorationTheme: widget.focusNode.hasFocus
? decorationTheme.copyWith(
errorStyle: const TextStyle(
fontSize: 0,
height: 0,
),
)
: decorationTheme,
),
child: widget.child,
),
),
],
);
}
}
import 'package:flutter/material.dart';
import 'package:vmeeting/src/controllers/enter_number_cont.dart';
class UserSignInPage extends StatefulWidget {
final NumberController controller;
const UserSignInPage({super.key, required this.controller});
@override
State<UserSignInPage> createState() => _UserSignInPageState();
}
class _UserSignInPageState extends State<UserSignInPage> {
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);
},
),
),
);
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../service/routes/routes_name.dart';
import '../../src/controllers/enter_number_cont.dart'; import '../../src/controllers/enter_number_cont.dart';
import '../../src/widgets/big_text_widget.dart'; import '../../src/widgets/big_text_widget.dart';
class SplashScreen extends StatefulWidget { class SplashScreen extends StatefulWidget {
...@@ -29,7 +30,7 @@ class _SplashScreenState extends State<SplashScreen> ...@@ -29,7 +30,7 @@ class _SplashScreenState extends State<SplashScreen>
..forward() ..forward()
..addStatusListener((status) async { ..addStatusListener((status) async {
if (status == AnimationStatus.completed) { if (status == AnimationStatus.completed) {
// Navigator.of(context).pushReplacementNamed(MainRoutes.sign_in_page); Navigator.of(context).pushReplacementNamed(MainRoutes.user_signin_page);
} }
}); });
_curvedAnimation = _curvedAnimation =
...@@ -52,7 +53,6 @@ class _SplashScreenState extends State<SplashScreen> ...@@ -52,7 +53,6 @@ class _SplashScreenState extends State<SplashScreen>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Colors.white,
body: Center( body: Center(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
...@@ -64,7 +64,7 @@ class _SplashScreenState extends State<SplashScreen> ...@@ -64,7 +64,7 @@ class _SplashScreenState extends State<SplashScreen>
width: 250, width: 250,
height: 250, height: 250,
child: child:
Image.asset('assets/videomeet.png', fit: BoxFit.fill), Image.asset('assets/mymeetinglogo.png', fit: BoxFit.fill),
), ),
), ),
), ),
......
...@@ -17,6 +17,14 @@ packages: ...@@ -17,6 +17,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.11.0" version: "2.11.0"
bloc:
dependency: transitive
description:
name: bloc
sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49"
url: "https://pub.dev"
source: hosted
version: "8.1.2"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
...@@ -145,6 +153,14 @@ packages: ...@@ -145,6 +153,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.0.0" version: "7.0.0"
equatable:
dependency: "direct main"
description:
name: equatable
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
url: "https://pub.dev"
source: hosted
version: "2.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
...@@ -173,10 +189,10 @@ packages: ...@@ -173,10 +189,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: firebase_core name: firebase_core
sha256: "37299e4907391d7fac8c7ea059bb3292768cc07b72b6c6c777675cc58da2ef4d" sha256: "7706f4ade6cc2698c70074083bc262586a185047f6bfdd53938dcc35d35cbb9e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.20.0" version: "2.21.0"
firebase_core_platform_interface: firebase_core_platform_interface:
dependency: transitive dependency: transitive
description: description:
...@@ -206,6 +222,14 @@ packages: ...@@ -206,6 +222,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
flutter_bloc:
dependency: "direct main"
description:
name: flutter_bloc
sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae
url: "https://pub.dev"
source: hosted
version: "8.1.3"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
...@@ -336,6 +360,14 @@ packages: ...@@ -336,6 +360,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
nested:
dependency: transitive
description:
name: nested
sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
objectid: objectid:
dependency: transitive dependency: transitive
description: description:
...@@ -504,6 +536,14 @@ packages: ...@@ -504,6 +536,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.7.3" version: "3.7.3"
provider:
dependency: transitive
description:
name: provider
sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f
url: "https://pub.dev"
source: hosted
version: "6.0.5"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
...@@ -521,7 +561,7 @@ packages: ...@@ -521,7 +561,7 @@ packages:
source: hosted source: hosted
version: "3.2.1" version: "3.2.1"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: transitive
description: description:
name: shared_preferences name: shared_preferences
sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
......
...@@ -36,7 +36,6 @@ dependencies: ...@@ -36,7 +36,6 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
connectycube_sdk: ^2.10.0 connectycube_sdk: ^2.10.0
shared_preferences: ^2.2.2
connectycube_flutter_call_kit: ^2.3.0 connectycube_flutter_call_kit: ^2.3.0
universal_io: ^2.2.2 universal_io: ^2.2.2
web_browser_detect: ^2.0.3 web_browser_detect: ^2.0.3
...@@ -48,6 +47,8 @@ dependencies: ...@@ -48,6 +47,8 @@ dependencies:
firebase_core: ^2.20.0 firebase_core: ^2.20.0
google_fonts: ^5.1.0 google_fonts: ^5.1.0
upgrader: ^8.1.0 upgrader: ^8.1.0
flutter_bloc: ^8.1.3
equatable: ^2.0.5
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment