Commit 2aaed4ba authored by Inomjon's avatar Inomjon

Call cannection to app

parent 35211982
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application <application
android:label="vmeeting" android:label="MyMeeting"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity
......
import 'dart:io';
import 'package:connectycube_flutter_call_kit/connectycube_flutter_call_kit.dart'; import 'package:connectycube_flutter_call_kit/connectycube_flutter_call_kit.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:connectycube_sdk/connectycube_sdk.dart'; import 'package:connectycube_sdk/connectycube_sdk.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:vmeeting/src/login_screen.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:upgrader/upgrader.dart';
import 'package:vmeeting/service/routes/app_routes.dart';
import 'package:vmeeting/service/routes/navigator_service.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;
...@@ -19,6 +23,7 @@ void main() async { ...@@ -19,6 +23,7 @@ void main() async {
} }
class App extends StatefulWidget { class App extends StatefulWidget {
static NavigationService navigationService = NavigationService();
const App({super.key}); const App({super.key});
@override @override
...@@ -28,17 +33,30 @@ class App extends StatefulWidget { ...@@ -28,17 +33,30 @@ class App extends StatefulWidget {
} }
class _AppState extends State<App> { class _AppState extends State<App> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData( debugShowCheckedModeBanner: false,
primarySwatch: Colors.green, theme: ThemeData(
), textTheme: GoogleFonts.latoTextTheme(),
home: Builder( ),
builder: (context) { title: 'Theme App',
return LoginScreen(); navigatorKey: App.navigationService.navigatorKey,
}, home: UpgradeAlert(
), upgrader: Upgrader(
canDismissDialog: true,
shouldPopScope: () => true,
cupertinoButtonTextStyle: GoogleFonts.lato(
textStyle: Theme.of(context).textTheme.bodyMedium,
fontSize: 14,
fontWeight: FontWeight.w600,
fontStyle: FontStyle.normal),
durationUntilAlertAgain: const Duration(days: 1),
dialogStyle: Platform.isIOS ? UpgradeDialogStyle.cupertino : UpgradeDialogStyle.material
),
child: const MainNavigator(),
)
); );
} }
......
// ignore_for_file: body_might_complete_normally_nullable
import 'package:flutter/material.dart';
import 'package:vmeeting/service/routes/routes_name.dart';
import '../../src/controllers/enter_number_cont.dart';
import '../../views/splash_view/splash_screen.dart';
GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
final NumberController _controller = NumberController();
class MainNavigator extends StatelessWidget {
const MainNavigator({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
var canPop = navigatorKey.currentState?.canPop() ?? false;
if (canPop) {
navigatorKey.currentState?.pop();
}
return !canPop;
},
child: Navigator(
key: navigatorKey,
initialRoute: MainRoutes.splash_screen,
onGenerateRoute: (RouteSettings settings) {
WidgetBuilder? builder;
switch (settings.name) {
case MainRoutes.splash_screen:
builder = (BuildContext _) => SplashScreen(controller: _controller,);
break;
// case MainRoutes.splash_screen:
// builder = (BuildContext _) => MultiBlocProvider(
// providers: [
// BlocProvider<CallPageBloc>(
// create: (context) => CallPageBloc(),
// ),
// ],
// child: MyMainPage(controller: _controller,),
// );
// break;
}
if (builder != null) {
return MaterialPageRoute(builder: builder, settings: settings);
}
},
onPopPage: (Route<dynamic> route, dynamic result) {
return route.didPop(result);
},
),
);
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
class NavigationService {
final GlobalKey<NavigatorState> navigatorKey =
GlobalKey<NavigatorState>();
Future<dynamic> navigateTo(String routeName) {
return navigatorKey.currentState!
.pushNamedAndRemoveUntil(routeName, ModalRoute.withName(routeName));
}
Future<dynamic> pushNamed(String routeName) {
return navigatorKey.currentState!.pushNamed(routeName);
}
dynamic pushNamedReplekName(String routeName) {
return navigatorKey.currentState!.restorablePushReplacementNamed(routeName);
}
dynamic goBack() {
return navigatorKey.currentState?.pop();
}
}
// ignore_for_file: constant_identifier_names
class MainRoutes {
static const String splash_screen = "splash_screen";
}
\ No newline at end of file
// ignore_for_file: constant_identifier_names
class BaseApi {
static const String SERVER_HOST = 'https://cld.alovoice.uz/mapi';
static const String SIGN_IN = "$SERVER_HOST/mlogin";
}
\ No newline at end of file
import 'package:flutter/material.dart';
class ColorConst {
static Color appWhiteColor = const Color(0xffFFFFFF);
static Color appMainColor = const Color(0xff8d9cf4);
static Color appBackgroundColor = const Color(0xffbec6f4);
static Color appSecondWhiteColor = const Color(0xfff1f3f4);
static Color appGreenColor = const Color(0xff7bcdd1);
}
\ No newline at end of file
import 'package:flutter/material.dart';
class SizeConst {
static const double kExtraSmallFont8 = 8.0;
static const double kSmallFont14 = 14.0;
static const double kMediumFont16 = 16.0;
static const double kMediumFont18 = 18.0;
static const double kLargeFont20 = 20.0;
static const double kExtraLargeFont24 = 24.0;
static const double kExtraLargeFont32 = 32.0;
}
class WeightsConst {
static FontWeight kNormalWeight = FontWeight.normal;
static FontWeight kBoldWeight = FontWeight.bold;
static FontWeight kSmallWeight400 = FontWeight.w400;
static FontWeight kMediumWeight600 = FontWeight.w600;
static FontWeight kLargeWeight800 = FontWeight.w800;
}
\ No newline at end of file
import 'dart:async';
class NumberController {
final StreamController<int> controller = StreamController<int>.broadcast();
Sink<int> get inputNumber => controller.sink;
Stream<int> get outputNumber => controller.stream;
}
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
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../constants/font_and_size_const.dart';
class BigText extends StatelessWidget {
final String text;
final double size;
final Color? color;
final FontWeight? fontWidget;
const BigText(
{Key? key,
required this.text,
this.size = SizeConst.kLargeFont20,
this.color,
this.fontWidget})
: super(key: key);
@override
Widget build(BuildContext context) {
return Text(
text,
style: GoogleFonts.lato(
textStyle: Theme.of(context).textTheme.bodyMedium,
fontSize: size,
fontWeight: fontWidget,
fontStyle: FontStyle.normal,
color: color,
),
);
}
}
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../constants/font_and_size_const.dart';
class SmallText extends StatelessWidget {
final String text;
final double size;
final Color? color;
final FontWeight? fontWidget;
final TextAlign? textAlign;
final int? maxLines;
final bool? softWrap;
final TextOverflow? textOverflow;
const SmallText(
{Key? key,
required this.text,
this.size = SizeConst.kSmallFont14,
this.color,
this.fontWidget,
this.textAlign,
this.maxLines = 1,
this.softWrap = false,
this.textOverflow = TextOverflow.fade,
})
: super(key: key);
@override
Widget build(BuildContext context) {
return Text(
text,
style: GoogleFonts.lato(
textStyle: Theme.of(context).textTheme.bodyMedium,
fontSize: size,
fontWeight: fontWidget,
fontStyle: FontStyle.normal,
color: color,),
textAlign: textAlign,
maxLines: maxLines,
softWrap: softWrap,
overflow: textOverflow,
);
}
}
import 'package:flutter/material.dart';
import '../../src/controllers/enter_number_cont.dart';
import '../../src/widgets/big_text_widget.dart';
class SplashScreen extends StatefulWidget {
final NumberController controller;
const SplashScreen({Key? key, required this.controller}) : super(key: key);
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen>
with TickerProviderStateMixin {
late AnimationController _animatedController;
late CurvedAnimation _curvedAnimation;
bool visibleButton = false;
bool isUserRegistered = false;
@override
void initState() {
super.initState();
init();
}
init() {
_animatedController =
AnimationController(duration: const Duration(seconds: 2), vsync: this)
..forward()
..addStatusListener((status) async {
if (status == AnimationStatus.completed) {
// Navigator.of(context).pushReplacementNamed(MainRoutes.sign_in_page);
}
});
_curvedAnimation =
CurvedAnimation(parent: _animatedController, curve: Curves.decelerate);
}
@override
void dispose() {
super.dispose();
_animatedController.dispose();
}
void restartAnimation() {
if (!_animatedController.isAnimating) {
_animatedController.reset();
_animatedController.forward();
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Align(
child: ScaleTransition(
scale: Tween(begin: 0.8, end: 1.0).animate(_curvedAnimation),
child: SizedBox(
width: 250,
height: 250,
child:
Image.asset('assets/videomeet.png', fit: BoxFit.fill),
),
),
),
const BigText(text: "MyMeeting",fontWidget: FontWeight.bold),
visibleButton
? Container(
margin: const EdgeInsets.symmetric(
horizontal: 48, vertical: 18),
child: TextButton(
onPressed: () {},
child: const Text("Coose Lenguage"),
),
)
: Container(),
],
),
),
);
}
}
\ No newline at end of file
...@@ -7,9 +7,13 @@ ...@@ -7,9 +7,13 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h> #include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) flutter_webrtc_registrar = g_autoptr(FlPluginRegistrar) flutter_webrtc_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterWebRTCPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterWebRTCPlugin");
flutter_web_r_t_c_plugin_register_with_registrar(flutter_webrtc_registrar); flutter_web_r_t_c_plugin_register_with_registrar(flutter_webrtc_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
flutter_webrtc flutter_webrtc
url_launcher_linux
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST
......
...@@ -11,6 +11,7 @@ import flutter_webrtc ...@@ -11,6 +11,7 @@ import flutter_webrtc
import package_info_plus import package_info_plus
import path_provider_foundation import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
...@@ -19,4 +20,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { ...@@ -19,4 +20,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
} }
...@@ -240,6 +240,14 @@ packages: ...@@ -240,6 +240,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.9.45" version: "0.9.45"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: e20ff62b158b96f392bfc8afe29dee1503c94fbea2cbe8186fd59b756b8ae982
url: "https://pub.dev"
source: hosted
version: "5.1.0"
html: html:
dependency: transitive dependency: transitive
description: description:
...@@ -336,6 +344,14 @@ packages: ...@@ -336,6 +344,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
os_detect:
dependency: transitive
description:
name: os_detect
sha256: faf3bcf39515e64da8ff76b2f2805b20a6ff47ae515393e535f8579ff91d6b7f
url: "https://pub.dev"
source: hosted
version: "2.0.1"
package_info_plus: package_info_plus:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -661,6 +677,78 @@ packages: ...@@ -661,6 +677,78 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.2.0" version: "0.2.0"
upgrader:
dependency: "direct main"
description:
name: upgrader
sha256: "889c1ece7af143df32e8ee2126f2ef17b2ab6bb7ed8fc3b1b022d7faa4fdab20"
url: "https://pub.dev"
source: hosted
version: "8.2.0"
url_launcher:
dependency: transitive
description:
name: url_launcher
sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba
url: "https://pub.dev"
source: hosted
version: "6.2.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
url: "https://pub.dev"
source: hosted
version: "6.2.0"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a"
url: "https://pub.dev"
source: hosted
version: "6.2.0"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
uuid: uuid:
dependency: transitive dependency: transitive
description: description:
...@@ -677,6 +765,14 @@ packages: ...@@ -677,6 +765,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
version:
dependency: transitive
description:
name: version
sha256: "3d4140128e6ea10d83da32fef2fa4003fccbf6852217bb854845802f04191f94"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
web: web:
dependency: transitive dependency: transitive
description: description:
...@@ -751,4 +847,4 @@ packages: ...@@ -751,4 +847,4 @@ packages:
version: "0.4.4-dev.4" version: "0.4.4-dev.4"
sdks: sdks:
dart: ">=3.1.3 <4.0.0" dart: ">=3.1.3 <4.0.0"
flutter: ">=3.7.0" flutter: ">=3.13.0"
...@@ -46,6 +46,8 @@ dependencies: ...@@ -46,6 +46,8 @@ dependencies:
device_info_plus: ^9.0.0 device_info_plus: ^9.0.0
package_info_plus: ^4.0.0 package_info_plus: ^4.0.0
firebase_core: ^2.20.0 firebase_core: ^2.20.0
google_fonts: ^5.1.0
upgrader: ^8.1.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
...@@ -70,9 +72,9 @@ flutter: ...@@ -70,9 +72,9 @@ flutter:
uses-material-design: true uses-material-design: true
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: assets:
# - images/a_dot_burr.jpeg - assets/
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware # https://flutter.dev/assets-and-images/#resolution-aware
......
...@@ -13,7 +13,7 @@ import 'package:vmeeting/main.dart'; ...@@ -13,7 +13,7 @@ import 'package:vmeeting/main.dart';
void main() { void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async { testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame. // Build our app and trigger a frame.
await tester.pumpWidget(const MyApp()); await tester.pumpWidget(const App());
// Verify that our counter starts at 0. // Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget); expect(find.text('0'), findsOneWidget);
......
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