Commit df7dbf8d authored by Inomjon's avatar Inomjon

Chat ishlatib ko'rildi

parent cd673c58
06edd3d07f0b028e0af881e89663c234
\ No newline at end of file
assets/contact_avatar.png  assetassets/contact_avatar.pngassets/loading.json  assetassets/loading.jsonassets/mymeetinglogo.png  assetassets/mymeetinglogo.png2packages/cupertino_icons/assets/CupertinoIcons.ttf  asset2packages/cupertino_icons/assets/CupertinoIcons.ttf
\ No newline at end of file
{"assets/contact_avatar.png":["assets/contact_avatar.png"],"assets/loading.json":["assets/loading.json"],"assets/mymeetinglogo.png":["assets/mymeetinglogo.png"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"]}
\ No newline at end of file
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]}]
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
{
"sksl": "// This SkSL shader is autogenerated by spirv-cross.\n\nfloat4 flutter_FragCoord;\n\nuniform vec4 u_color;\nuniform float u_alpha;\nuniform vec4 u_sparkle_color;\nuniform float u_sparkle_alpha;\nuniform float u_blur;\nuniform vec2 u_center;\nuniform float u_radius_scale;\nuniform float u_max_radius;\nuniform vec2 u_resolution_scale;\nuniform vec2 u_noise_scale;\nuniform float u_noise_phase;\nuniform vec2 u_circle1;\nuniform vec2 u_circle2;\nuniform vec2 u_circle3;\nuniform vec2 u_rotation1;\nuniform vec2 u_rotation2;\nuniform vec2 u_rotation3;\n\nvec4 fragColor;\n\nvec2 FLT_flutter_local_FlutterFragCoord()\n{\n return flutter_FragCoord.xy;\n}\n\nmat2 FLT_flutter_local_rotate2d(vec2 rad)\n{\n return mat2(vec2(rad.x, -rad.y), vec2(rad.y, rad.x));\n}\n\nfloat FLT_flutter_local_soft_circle(vec2 uv, vec2 xy, float radius, float blur)\n{\n float blur_half = blur * 0.5;\n float d = distance(uv, xy);\n return 1.0 - smoothstep(1.0 - blur_half, 1.0 + blur_half, d / radius);\n}\n\nfloat FLT_flutter_local_circle_grid(vec2 resolution, inout vec2 p, vec2 xy, vec2 rotation, float cell_diameter)\n{\n vec2 param = rotation;\n p = (FLT_flutter_local_rotate2d(param) * (xy - p)) + xy;\n p = mod(p, vec2(cell_diameter)) / resolution;\n float cell_uv = (cell_diameter / resolution.y) * 0.5;\n float r = 0.64999997615814208984375 * cell_uv;\n vec2 param_1 = p;\n vec2 param_2 = vec2(cell_uv);\n float param_3 = r;\n float param_4 = r * 50.0;\n return FLT_flutter_local_soft_circle(param_1, param_2, param_3, param_4);\n}\n\nfloat FLT_flutter_local_turbulence(vec2 uv)\n{\n vec2 uv_scale = uv * vec2(0.800000011920928955078125);\n vec2 param = vec2(0.800000011920928955078125);\n vec2 param_1 = uv_scale;\n vec2 param_2 = u_circle1;\n vec2 param_3 = u_rotation1;\n float param_4 = 0.17000000178813934326171875;\n float _301 = FLT_flutter_local_circle_grid(param, param_1, param_2, param_3, param_4);\n float g1 = _301;\n vec2 param_5 = vec2(0.800000011920928955078125);\n vec2 param_6 = uv_scale;\n vec2 param_7 = u_circle2;\n vec2 param_8 = u_rotation2;\n float param_9 = 0.20000000298023223876953125;\n float _313 = FLT_flutter_local_circle_grid(param_5, param_6, param_7, param_8, param_9);\n float g2 = _313;\n vec2 param_10 = vec2(0.800000011920928955078125);\n vec2 param_11 = uv_scale;\n vec2 param_12 = u_circle3;\n vec2 param_13 = u_rotation3;\n float param_14 = 0.2750000059604644775390625;\n float _326 = FLT_flutter_local_circle_grid(param_10, param_11, param_12, param_13, param_14);\n float g3 = _326;\n float v = (((g1 * g1) + g2) - g3) * 0.5;\n return clamp(0.449999988079071044921875 + (0.800000011920928955078125 * v), 0.0, 1.0);\n}\n\nfloat FLT_flutter_local_soft_ring(vec2 uv, vec2 xy, float radius, float thickness, float blur)\n{\n vec2 param = uv;\n vec2 param_1 = xy;\n float param_2 = radius + thickness;\n float param_3 = blur;\n float circle_outer = FLT_flutter_local_soft_circle(param, param_1, param_2, param_3);\n vec2 param_4 = uv;\n vec2 param_5 = xy;\n float param_6 = max(radius - thickness, 0.0);\n float param_7 = blur;\n float circle_inner = FLT_flutter_local_soft_circle(param_4, param_5, param_6, param_7);\n return clamp(circle_outer - circle_inner, 0.0, 1.0);\n}\n\nfloat FLT_flutter_local_triangle_noise(inout vec2 n)\n{\n n = fract(n * vec2(5.398700237274169921875, 5.442100048065185546875));\n n += vec2(dot(n.yx, n + vec2(21.5351009368896484375, 14.3136997222900390625)));\n float xy = n.x * n.y;\n return (fract(xy * 95.43070220947265625) + fract(xy * 75.0496063232421875)) - 1.0;\n}\n\nfloat FLT_flutter_local_threshold(float v, float l, float h)\n{\n return step(l, v) * (1.0 - step(h, v));\n}\n\nfloat FLT_flutter_local_sparkle(vec2 uv, float t)\n{\n vec2 param = uv;\n float _224 = FLT_flutter_local_triangle_noise(param);\n float n = _224;\n float param_1 = n;\n float param_2 = 0.0;\n float param_3 = 0.0500000007450580596923828125;\n float s = FLT_flutter_local_threshold(param_1, param_2, param_3);\n float param_4 = n + sin(3.1415927410125732421875 * (t + 0.3499999940395355224609375));\n float param_5 = 0.100000001490116119384765625;\n float param_6 = 0.1500000059604644775390625;\n s += FLT_flutter_local_threshold(param_4, param_5, param_6);\n float param_7 = n + sin(3.1415927410125732421875 * (t + 0.699999988079071044921875));\n float param_8 = 0.20000000298023223876953125;\n float param_9 = 0.25;\n s += FLT_flutter_local_threshold(param_7, param_8, param_9);\n float param_10 = n + sin(3.1415927410125732421875 * (t + 1.0499999523162841796875));\n float param_11 = 0.300000011920928955078125;\n float param_12 = 0.3499999940395355224609375;\n s += FLT_flutter_local_threshold(param_10, param_11, param_12);\n return clamp(s, 0.0, 1.0) * 0.550000011920928955078125;\n}\n\nvoid FLT_main()\n{\n vec2 p = FLT_flutter_local_FlutterFragCoord();\n vec2 uv_1 = p * u_resolution_scale;\n vec2 density_uv = uv_1 - mod(p, u_noise_scale);\n float radius = u_max_radius * u_radius_scale;\n vec2 param_13 = uv_1;\n float turbulence = FLT_flutter_local_turbulence(param_13);\n vec2 param_14 = p;\n vec2 param_15 = u_center;\n float param_16 = radius;\n float param_17 = 0.0500000007450580596923828125 * u_max_radius;\n float param_18 = u_blur;\n float ring = FLT_flutter_local_soft_ring(param_14, param_15, param_16, param_17, param_18);\n vec2 param_19 = density_uv;\n float param_20 = u_noise_phase;\n float sparkle = ((FLT_flutter_local_sparkle(param_19, param_20) * ring) * turbulence) * u_sparkle_alpha;\n vec2 param_21 = p;\n vec2 param_22 = u_center;\n float param_23 = radius;\n float param_24 = u_blur;\n float wave_alpha = (FLT_flutter_local_soft_circle(param_21, param_22, param_23, param_24) * u_alpha) * u_color.w;\n vec4 wave_color = vec4(u_color.xyz * wave_alpha, wave_alpha);\n vec4 sparkle_color = vec4(u_sparkle_color.xyz * u_sparkle_color.w, u_sparkle_color.w);\n fragColor = mix(wave_color, sparkle_color, vec4(sparkle));\n}\n\nhalf4 main(float2 iFragCoord)\n{\n flutter_FragCoord = float4(iFragCoord, 0, 0);\n FLT_main();\n return fragColor;\n}\n",
"stage": 1,
"target_platform": 2,
"uniforms": [
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 0,
"name": "u_color",
"rows": 4,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 1,
"name": "u_alpha",
"rows": 1,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 2,
"name": "u_sparkle_color",
"rows": 4,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 3,
"name": "u_sparkle_alpha",
"rows": 1,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 4,
"name": "u_blur",
"rows": 1,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 5,
"name": "u_center",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 6,
"name": "u_radius_scale",
"rows": 1,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 7,
"name": "u_max_radius",
"rows": 1,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 8,
"name": "u_resolution_scale",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 9,
"name": "u_noise_scale",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 10,
"name": "u_noise_phase",
"rows": 1,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 11,
"name": "u_circle1",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 12,
"name": "u_circle2",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 13,
"name": "u_circle3",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 14,
"name": "u_rotation1",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 15,
"name": "u_rotation2",
"rows": 2,
"type": 10
},
{
"array_elements": 0,
"bit_width": 32,
"columns": 1,
"location": 16,
"name": "u_rotation3",
"rows": 2,
"type": 10
}
]
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\n");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var module=Module["wasmModule"];Module["wasmModule"]=null;var instance=new WebAssembly.Instance(module,info);return receiveInstance(instance)};self.onunhandledrejection=e=>{throw e.reason??e};function handleMessage(e){try{if(e.data.cmd==="load"){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}skwasm(Module)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}}self.onmessage=handleMessage;
This diff is collapsed.
'use strict';
const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {"assets/AssetManifest.bin": "65e028717d32de5857ab089092b00784",
"assets/AssetManifest.json": "ee6d3985235c95aed3f5b48d9a3e5964",
"assets/assets/contact_avatar.png": "412e3e7cbcf481d23f2f14bd39ca0eb1",
"assets/assets/loading.json": "d244b45026f841a1379c4c9215a74be7",
"assets/assets/mymeetinglogo.png": "adf31f515626b9f0d1eb113ad15c368b",
"assets/FontManifest.json": "dc3d03800ccca4601324923c0b1d6d57",
"assets/fonts/MaterialIcons-Regular.otf": "0ad5613ba032e74c3b3c108c814fc703",
"assets/NOTICES": "42df3b418c8c6ef292f0ae7dc5c4151c",
"assets/packages/cupertino_icons/assets/CupertinoIcons.ttf": "89ed8f4e49bcdfc0b5bfc9b24591e347",
"assets/shaders/ink_sparkle.frag": "f8b80e740d33eb157090be4e995febdf",
"canvaskit/canvaskit.js": "bbf39143dfd758d8d847453b120c8ebb",
"canvaskit/canvaskit.wasm": "42df12e09ecc0d5a4a34a69d7ee44314",
"canvaskit/chromium/canvaskit.js": "96ae916cd2d1b7320fff853ee22aebb0",
"canvaskit/chromium/canvaskit.wasm": "be0e3b33510f5b7b0cc76cc4d3e50048",
"canvaskit/skwasm.js": "95f16c6690f955a45b2317496983dbe9",
"canvaskit/skwasm.wasm": "1a074e8452fe5e0d02b112e22cdcf455",
"canvaskit/skwasm.worker.js": "51253d3321b11ddb8d73fa8aa87d3b15",
"favicon.png": "c237f3bfe305044077ff4bd2e7805651",
"flutter.js": "6b515e434cea20006b3ef1726d2c8894",
"icons/Icon-192.png": "8492e98f9e23d2757c184a797dd98562",
"icons/Icon-512.png": "3f113298f30f1c8dc1c1ee492b49dd34",
"icons/Icon-maskable-192.png": "8492e98f9e23d2757c184a797dd98562",
"icons/Icon-maskable-512.png": "3f113298f30f1c8dc1c1ee492b49dd34",
"index.html": "105632bd2c8325d723de590ca512a8db",
"/": "105632bd2c8325d723de590ca512a8db",
"main.dart.js": "38f4f276e78abc51f9fc8401f947b429",
"manifest.json": "06a98e3db4ad33d77b572058d067487e",
"version.json": "78ebccf0708fa628ba423077e482533d"};
// The application shell files that are downloaded before a service worker can
// start.
const CORE = ["main.dart.js",
"index.html",
"assets/AssetManifest.json",
"assets/FontManifest.json"];
// During install, the TEMP cache is populated with the application shell files.
self.addEventListener("install", (event) => {
self.skipWaiting();
return event.waitUntil(
caches.open(TEMP).then((cache) => {
return cache.addAll(
CORE.map((value) => new Request(value, {'cache': 'reload'})));
})
);
});
// During activate, the cache is populated with the temp files downloaded in
// install. If this service worker is upgrading from one with a saved
// MANIFEST, then use this to retain unchanged resource files.
self.addEventListener("activate", function(event) {
return event.waitUntil(async function() {
try {
var contentCache = await caches.open(CACHE_NAME);
var tempCache = await caches.open(TEMP);
var manifestCache = await caches.open(MANIFEST);
var manifest = await manifestCache.match('manifest');
// When there is no prior manifest, clear the entire cache.
if (!manifest) {
await caches.delete(CACHE_NAME);
contentCache = await caches.open(CACHE_NAME);
for (var request of await tempCache.keys()) {
var response = await tempCache.match(request);
await contentCache.put(request, response);
}
await caches.delete(TEMP);
// Save the manifest to make future upgrades efficient.
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
// Claim client to enable caching on first launch
self.clients.claim();
return;
}
var oldManifest = await manifest.json();
var origin = self.location.origin;
for (var request of await contentCache.keys()) {
var key = request.url.substring(origin.length + 1);
if (key == "") {
key = "/";
}
// If a resource from the old manifest is not in the new cache, or if
// the MD5 sum has changed, delete it. Otherwise the resource is left
// in the cache and can be reused by the new service worker.
if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
await contentCache.delete(request);
}
}
// Populate the cache with the app shell TEMP files, potentially overwriting
// cache files preserved above.
for (var request of await tempCache.keys()) {
var response = await tempCache.match(request);
await contentCache.put(request, response);
}
await caches.delete(TEMP);
// Save the manifest to make future upgrades efficient.
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
// Claim client to enable caching on first launch
self.clients.claim();
return;
} catch (err) {
// On an unhandled exception the state of the cache cannot be guaranteed.
console.error('Failed to upgrade service worker: ' + err);
await caches.delete(CACHE_NAME);
await caches.delete(TEMP);
await caches.delete(MANIFEST);
}
}());
});
// The fetch handler redirects requests for RESOURCE files to the service
// worker cache.
self.addEventListener("fetch", (event) => {
if (event.request.method !== 'GET') {
return;
}
var origin = self.location.origin;
var key = event.request.url.substring(origin.length + 1);
// Redirect URLs to the index.html
if (key.indexOf('?v=') != -1) {
key = key.split('?v=')[0];
}
if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
key = '/';
}
// If the URL is not the RESOURCE list then return to signal that the
// browser should take over.
if (!RESOURCES[key]) {
return;
}
// If the URL is the index.html, perform an online-first request.
if (key == '/') {
return onlineFirst(event);
}
event.respondWith(caches.open(CACHE_NAME)
.then((cache) => {
return cache.match(event.request).then((response) => {
// Either respond with the cached resource, or perform a fetch and
// lazily populate the cache only if the resource was successfully fetched.
return response || fetch(event.request).then((response) => {
if (response && Boolean(response.ok)) {
cache.put(event.request, response.clone());
}
return response;
});
})
})
);
});
self.addEventListener('message', (event) => {
// SkipWaiting can be used to immediately activate a waiting service worker.
// This will also require a page refresh triggered by the main worker.
if (event.data === 'skipWaiting') {
self.skipWaiting();
return;
}
if (event.data === 'downloadOffline') {
downloadOffline();
return;
}
});
// Download offline will check the RESOURCES for all files not in the cache
// and populate them.
async function downloadOffline() {
var resources = [];
var contentCache = await caches.open(CACHE_NAME);
var currentContent = {};
for (var request of await contentCache.keys()) {
var key = request.url.substring(origin.length + 1);
if (key == "") {
key = "/";
}
currentContent[key] = true;
}
for (var resourceKey of Object.keys(RESOURCES)) {
if (!currentContent[resourceKey]) {
resources.push(resourceKey);
}
}
return contentCache.addAll(resources);
}
// Attempt to download the resource online before falling back to
// the offline cache.
function onlineFirst(event) {
return event.respondWith(
fetch(event.request).then((response) => {
return caches.open(CACHE_NAME).then((cache) => {
cache.put(event.request, response.clone());
return response;
});
}).catch((error) => {
return caches.open(CACHE_NAME).then((cache) => {
return cache.match(event.request).then((response) => {
if (response != null) {
return response;
}
throw error;
});
});
})
);
}
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="/">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="vmeeting">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>vmeeting</title>
<link rel="manifest" href="manifest.json">
<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = "1232452124";
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>
<body>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function(engineInitializer) {
engineInitializer.initializeEngine().then(function(appRunner) {
appRunner.runApp();
});
}
});
});
</script>
</body>
</html>
This diff is collapsed.
{
"name": "vmeeting",
"short_name": "vmeeting",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
{"app_name":"vmeeting","version":"1.0.0","build_number":"1","package_name":"vmeeting"}
\ No newline at end of file
class AppUsersModel {
UserModel? user;
AppUsersModel({this.user});
AppUsersModel.fromJson(Map<String, dynamic> json) {
user = json['user'] != null ? UserModel.fromJson(json['user']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (user != null) {
data['user'] = user!.toJson();
}
return data;
}
}
class UserModel {
String? sId;
int? id;
String? createdAt;
String? updatedAt;
String? lastRequestAt;
String? timezone;
String? login;
String? email;
String? fullName;
String? phone;
String? website;
String? twitterId;
String? externalUserId;
String? facebookId;
String? customData;
String? userTags;
String? avatar;
String? externalId;
String? isGuest;
UserModel(
{this.sId,
this.id,
this.createdAt,
this.updatedAt,
this.lastRequestAt,
this.timezone,
this.login,
this.email,
this.fullName,
this.phone,
this.website,
this.twitterId,
this.externalUserId,
this.facebookId,
this.customData,
this.userTags,
this.avatar,
this.externalId,
this.isGuest});
UserModel.fromJson(Map<String, dynamic> json) {
sId = json['_id'];
id = json['id'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
lastRequestAt = json['last_request_at'];
timezone = json['timezone'].toString();
login = json['login'];
email = json['email'];
fullName = json['full_name'];
phone = json['phone'];
website = json['website'];
twitterId = json['twitter_id'];
externalUserId = json['external_user_id'].toString();
facebookId = json['facebook_id'];
customData = json['custom_data'].toString();
userTags = json['user_tags'].toString();
avatar = json['avatar'];
externalId = json['external_id'];
isGuest = json['is_guest'].toString();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['_id'] = sId;
data['id'] = id;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
data['last_request_at'] = lastRequestAt;
data['timezone'] = timezone;
data['login'] = login;
data['email'] = email;
data['full_name'] = fullName;
data['phone'] = phone;
data['website'] = website;
data['twitter_id'] = twitterId;
data['external_user_id'] = externalUserId;
data['facebook_id'] = facebookId;
data['custom_data'] = customData;
data['user_tags'] = userTags;
data['avatar'] = avatar;
data['external_id'] = externalId;
data['is_guest'] = isGuest;
return data;
}
}
\ No newline at end of file
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';
class EditProfileBloc extends Bloc<EditProfileEvent, EditProfileState> {
EditProfileBloc() : super(EditProfileInitialState()) {
on<EditProfileEvent>((event, emit) {
emit(EditProfileLoadedState(user: AppUtils.cubeUser));
});
on<EditProfileUpdateEvent>((event, emit) async {
try{
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()));
}
});
}
}
part of 'edit_profile_bloc.dart';
@immutable
abstract class EditProfileEvent extends Equatable{}
class EditProfileFetchEvent extends EditProfileEvent{
@override
List<Object?> get props => [];
}
class EditProfileUpdateEvent extends EditProfileEvent{
final BuildContext context;
final NumberController? controller;
final CubeUser? user;
EditProfileUpdateEvent({required this.context, this.controller, this.user});
@override
List<Object?> get props => [user];
}
part of 'edit_profile_bloc.dart';
@immutable
abstract class EditProfileState extends Equatable{}
class EditProfileInitialState extends EditProfileState {
@override
// TODO: implement props
List<Object?> get props => [];
}
class EditProfileLoadedState extends EditProfileState{
final CubeUser user;
EditProfileLoadedState({required this.user});
@override
List<Object?> get props => [user];
}
class EditProfileExceptionState extends EditProfileState{
final String message;
EditProfileExceptionState({required this.message});
@override
List<Object?> get props => [message];
}
\ No newline at end of file
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
import 'package:vmeeting/service/user_repositores/user_repo.dart';
import '../../app_models/app_users_model/app_users_model.dart';
part 'home_page_event.dart';
part 'home_page_state.dart';
class HomePageBloc extends Bloc<HomePageEvent, HomePageState> {
late List<AppUsersModel> appUsersModelList = [];
HomePageBloc() : super(HomePageInitialState()){
on<HomePageFetchEvent>((event, emit) async {
appUsersModelList.addAll(await UserRepository.getInstance().getAppAllUsers());
emit(HomePageLoadedState(appUsersModelList: appUsersModelList));
});
}
}
part of 'home_page_bloc.dart';
@immutable
abstract class HomePageEvent extends Equatable{}
class HomePageFetchEvent extends HomePageEvent{
@override
List<Object?> get props => [];
}
part of 'home_page_bloc.dart';
@immutable
abstract class HomePageState extends Equatable{}
class HomePageInitialState extends HomePageState {
@override
List<Object?> get props => [];
}
class HomePageLoadedState extends HomePageState {
final List<AppUsersModel> appUsersModelList;
HomePageLoadedState({required this.appUsersModelList});
@override
List<Object?> get props => [appUsersModelList];
}
class HomePageExceptionState extends HomePageState {
final String message;
HomePageExceptionState({required this.message});
@override
List<Object?> get props => [message];
}
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/src/controllers/enter_number_cont.dart';
import '../../service/user_repositores/user_repo.dart';
part 'user_log_in_event.dart';
part 'user_log_in_state.dart';
class UserLogInBloc extends Bloc<UserLogInEvent, UserLogInState> {
UserLogInBloc() : super(UserLogInInitialState()) {
on<UserLogInFetchEvent>((event, emit) {
emit(UserLogInLoadedState());
});
on<UserLogInChakingEvent>((event, emit) async {
UserRepository.getInstance().userSigIn(context: event.context, user: event.user, controller: event.controller);
});
on<UserLogInChakedEvent>((event, emit) async {
emit(UserLogInInitialState());
bool response = await UserRepository.getInstance().userSigIn(context: event.context, user: event.user, controller: event.controller);
if(response == false){
emit(UserLogInLoadedState());
}
});
}
}
part of 'user_log_in_bloc.dart';
@immutable
abstract class UserLogInEvent extends Equatable{}
class UserLogInFetchEvent extends UserLogInEvent{
@override
List<Object?> get props => [];
}
class UserLogInChakingEvent extends UserLogInEvent{
final BuildContext context;
final CubeUser user;
final NumberController controller;
UserLogInChakingEvent({required this.controller, required this.context, required this.user});
@override
List<Object?> get props => [context,user, controller];
}
class UserLogInChakedEvent extends UserLogInEvent{
final BuildContext context;
final CubeUser user;
final NumberController controller;
UserLogInChakedEvent({required this.controller, required this.context, required this.user});
@override
List<Object?> get props => [context,user, controller];
}
\ No newline at end of file
part of 'user_log_in_bloc.dart';
@immutable
abstract class UserLogInState extends Equatable{}
class UserLogInInitialState extends UserLogInState {
@override
List<Object?> get props => [];
}
class UserLogInLoadedState extends UserLogInState {
@override
List<Object?> get props => [];
}
class UserLogInInChackingState extends UserLogInState {
@override
List<Object?> get props => [];
}
class UserLogInExceptionState extends UserLogInState {
final String? message;
UserLogInExceptionState({required this.message});
@override
List<Object?> get props => [message];
}
\ No newline at end of file
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 '../../service/user_repositores/user_repo.dart';
import '../../src/controllers/enter_number_cont.dart';
part 'user_sign_up_event.dart';
part 'user_sign_up_state.dart';
class UserSignUpBloc extends Bloc<UserSignUpEvent, UserSignUpState> {
UserSignUpBloc() : super(UserSignUpInitialState()) {
on<UserSignUpFetchEvent>((event, emit) {
emit(UserSignUpLoadedState());
});
on<UserSignUpChakingEvent>((event, emit) {
UserRepository.getInstance().userSigUp(context: event.context, user: event.user, controller: event.controller);
emit(UserSignUpLoadedState());
});
}
}
part of 'user_sign_up_bloc.dart';
@immutable
abstract class UserSignUpEvent extends Equatable{}
class UserSignUpFetchEvent extends UserSignUpEvent{
@override
List<Object?> get props => [];
}
class UserSignUpChakingEvent extends UserSignUpEvent {
final BuildContext context;
final CubeUser user;
final NumberController controller;
UserSignUpChakingEvent({required this.controller, required this.context, required this.user});
@override
List<Object?> get props => [context,user, controller];
}
part of 'user_sign_up_bloc.dart';
@immutable
abstract class UserSignUpState extends Equatable{}
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
import 'dart:io'; import 'dart:async';
import 'package:connectycube_flutter_call_kit/connectycube_flutter_call_kit.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.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:google_fonts/google_fonts.dart'; import 'package:universal_io/io.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/constants/app_themes/app_themes.dart';
import 'package:vmeeting/src/controllers/enter_number_cont.dart';
import 'package:vmeeting/src/utils/pref_util.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
import 'src/chat_details_screen.dart';
import 'src/chat_dialog_screen.dart';
import 'src/chat_dialog_resizable_screen.dart';
import 'src/login_screen.dart';
import 'src/managers/push_notifications_manager.dart';
import 'src/select_dialog_screen.dart';
import 'src/settings_screen.dart';
import 'src/utils/auth_utils.dart';
import 'src/utils/configs.dart' as config; import 'src/utils/configs.dart' as config;
import 'src/utils/consts.dart';
import 'src/utils/platform_utils.dart' as platformUtils;
import 'src/utils/pref_util.dart';
import 'src/utils/route_utils.dart';
void main() async { Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); log('[main]');
runApp(const App());
if (kIsWeb || !(Platform.isLinux && Platform.isWindows)) {
log('[main] init Firebase');
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseMessaging.onBackgroundMessage(onBackgroundMessage);
}
runApp(App());
} }
class App extends StatefulWidget { class App extends StatefulWidget {
static NavigationService navigationService = NavigationService();
const App({super.key});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _AppState(); return _AppState();
} }
} }
class _AppState extends State<App> { class _AppState extends State<App> with WidgetsBindingObserver {
final NumberController controller = NumberController(); late StreamSubscription<ConnectivityResult> connectivityStateSubscription;
AppLifecycleState? appState;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return (!kIsWeb) return MaterialApp(
? StreamBuilder( theme: ThemeData(
stream: controller.outputTheme, primarySwatch: Colors.green,
initialData: false, ),
builder: (BuildContext context, snapshot) { home: LoginScreen(),
return MaterialApp( navigatorKey: Navigation.mainNavigation,
debugShowCheckedModeBanner: false, onGenerateRoute: (settings) {
theme: getAppTheme(context, snapshot.data ?? false), String? name = settings.name;
title: 'MyMeeting', Map<String, dynamic>? args =
navigatorKey: App.navigationService.navigatorKey, settings.arguments as Map<String, dynamic>?;
home: UpgradeAlert(
upgrader: Upgrader( MaterialPageRoute pageRout;
canDismissDialog: true,
shouldPopScope: () => true, switch (name) {
cupertinoButtonTextStyle: GoogleFonts.lato( case 'chat_dialog':
textStyle: Theme.of(context).textTheme.bodyMedium, pageRout = MaterialPageRoute(
fontSize: 14, builder: (context) => platformUtils.isDesktop()
fontWeight: FontWeight.w600, ? ChatDialogResizableScreen(
fontStyle: FontStyle.normal), args![USER_ARG_NAME], args[DIALOG_ARG_NAME])
durationUntilAlertAgain: const Duration(days: 1), : ChatDialogScreen(
dialogStyle: Platform.isIOS args![USER_ARG_NAME], args[DIALOG_ARG_NAME]));
? UpgradeDialogStyle.cupertino break;
: UpgradeDialogStyle.material),
child: MainNavigator(controller: controller), case 'chat_dialog_resizable':
)); pageRout = MaterialPageRoute<bool>(
}) builder: (context) => ChatDialogResizableScreen(
: MaterialApp( args![USER_ARG_NAME], args[DIALOG_ARG_NAME]),
debugShowCheckedModeBanner: false, );
theme: ThemeData(
textTheme: GoogleFonts.latoTextTheme(), break;
primarySwatch: Colors.green,
), case 'chat_details':
title: 'MyMeeting', pageRout = MaterialPageRoute(
navigatorKey: App.navigationService.navigatorKey, builder: (context) => ChatDetailsScreen(
home: MainNavigator(controller: controller), args![USER_ARG_NAME], args[DIALOG_ARG_NAME]));
); break;
case 'select_dialog':
pageRout = MaterialPageRoute<bool>(
builder: (context) => platformUtils.isDesktop()
? ChatDialogResizableScreen(
args![USER_ARG_NAME], args[DIALOG_ARG_NAME])
: SelectDialogScreen(args![USER_ARG_NAME], null, null));
break;
case 'login':
pageRout = MaterialPageRoute(builder: (context) => LoginScreen());
break;
case 'settings':
pageRout = MaterialPageRoute(
builder: (context) => SettingsScreen(args![USER_ARG_NAME]));
break;
default:
pageRout = MaterialPageRoute(builder: (context) => LoginScreen());
break;
}
PushNotificationsManager.instance.onNotificationClicked = (payload) {
return onNotificationSelected(payload, pageRout.subtreeContext);
};
return pageRout;
},
);
} }
@override @override
void initState() { void initState() {
super.initState(); super.initState();
ConnectycubeFlutterCallKit.instance.init(); init(config.APP_ID, config.AUTH_KEY, config.AUTH_SECRET,
onSessionRestore: () async {
SharedPrefs sharedPrefs = await SharedPrefs.instance.init();
initConnectycube(); if (LoginType.phone == sharedPrefs.getLoginType()) {
} return createPhoneAuthSession();
} }
initConnectycube() { return createSession(sharedPrefs.getUser());
init( });
config.APP_ID,
config.AUTH_KEY,
config.AUTH_SECRET,
onSessionRestore: () {
return SharedPrefs.getUser().then((savedUser) {
return createSession(savedUser);
});
},
);
}
initConnectycubeContextLess() { // setEndpoints("", ""); // set custom API and Char server domains
CubeSettings.instance.applicationId = config.APP_ID;
CubeSettings.instance.authorizationKey = config.AUTH_KEY; connectivityStateSubscription =
CubeSettings.instance.authorizationSecret = config.AUTH_SECRET; Connectivity().onConnectivityChanged.listen((connectivityType) {
CubeSettings.instance.onSessionRestore = () { if (AppLifecycleState.resumed != appState) return;
return SharedPrefs.getUser().then((savedUser) {
return createSession(savedUser); if (connectivityType != ConnectivityResult.none) {
log("chatConnectionState = ${CubeChatConnection.instance.chatConnectionState}");
bool isChatDisconnected =
CubeChatConnection.instance.chatConnectionState ==
CubeChatConnectionState.Closed ||
CubeChatConnection.instance.chatConnectionState ==
CubeChatConnectionState.ForceClosed;
if (isChatDisconnected &&
CubeChatConnection.instance.currentUser != null) {
CubeChatConnection.instance.relogin();
}
}
}); });
};
appState = WidgetsBinding.instance.lifecycleState;
WidgetsBinding.instance.addObserver(this);
}
@override
void dispose() {
connectivityStateSubscription.cancel();
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
log("Current app state: $state");
appState = state;
if (AppLifecycleState.paused == state) {
if (CubeChatConnection.instance.isAuthenticated()) {
CubeChatConnection.instance.markInactive();
}
} else if (AppLifecycleState.resumed == state) {
// just for an example user was saved in the local storage
SharedPrefs.instance.init().then((sharedPrefs) async {
CubeUser? user = sharedPrefs.getUser();
if (user != null) {
if (!CubeChatConnection.instance.isAuthenticated()) {
if (LoginType.phone == sharedPrefs.getLoginType()) {
if(CubeSessionManager.instance.isActiveSessionValid()){
user.password = CubeSessionManager.instance.activeSession?.token;
} else {
var phoneAuthSession = await createPhoneAuthSession();
user.password = phoneAuthSession.token;
}
}
CubeChatConnection.instance.login(user);
} else {
CubeChatConnection.instance.markActive();
}
}
});
}
}
} }
// ignore_for_file: body_might_complete_normally_nullable
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:vmeeting/blocs/edit_profile_bloc/edit_profile_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/main_view/main_page.dart';
import '../../blocs/user_login_bloc/user_log_in_bloc.dart';
import '../../src/controllers/enter_number_cont.dart';
import '../../src/login_screen.dart';
import '../../views/edit_profile_view/edit_profile_page.dart';
import '../../views/reset_password_view/reset_password_page.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>();
class MainNavigator extends StatelessWidget {
final NumberController controller;
const MainNavigator({Key? key, required this.controller}) : 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.old_sign_in:
builder = (BuildContext _) => LoginScreen();
break;
case MainRoutes.main_page:
builder = (BuildContext _) => MainPage(controller: controller);
break;
case MainRoutes.reset_password_page:
builder = (BuildContext _) => ResetPasswordPage(controller: controller);
break;
case MainRoutes.user_signup_page:
builder = (BuildContext _) => MultiBlocProvider(
providers: [
BlocProvider<UserSignUpBloc>(
create: (context) => UserSignUpBloc(),
),
],
child: UserSignUpPage(controller: controller),
);
break;
case MainRoutes.sign_in_page:
builder = (BuildContext _) => MultiBlocProvider(
providers: [
BlocProvider<UserLogInBloc>(
create: (context) => UserLogInBloc(),
),
],
child: UserSignInPage(controller: controller),
);
break;
case MainRoutes.edit_profile_page:
builder = (BuildContext _) => MultiBlocProvider(
providers: [
BlocProvider<EditProfileBloc>(
create: (context) => EditProfileBloc(),
),
],
child: EditProfilePage(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";
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";
static const String old_sign_in = "old_sign_in";
static const String edit_profile_page = "edit_profile_page";
static const String reset_password_page = "reset_password_page";
}
\ No newline at end of file
import 'package:connectycube_sdk/connectycube_calls.dart';
import 'package:connectycube_sdk/connectycube_chat.dart';
import 'package:connectycube_sdk/connectycube_storage.dart';
import 'package:flutter/cupertino.dart';
import 'package:universal_io/io.dart';
import 'package:vmeeting/src/controllers/enter_number_cont.dart';
import 'package:vmeeting/src/utils/app_utils.dart';
import '../../app_models/app_users_model/app_users_model.dart';
import '../../src/utils/configs.dart';
import '../../src/utils/pref_util.dart';
import '../../src/utils/show_dialogs.dart';
import '../routes/routes_name.dart';
class UserRepository {
static final UserRepository _singleton = UserRepository._internal();
UserRepository._internal();
static UserRepository getInstance() {
return _singleton;
}
Future<bool> userSigIn({required BuildContext context, required CubeUser user, required NumberController controller}) async {
bool isChaking = true;
if (CubeSessionManager.instance.isActiveSessionValid() && CubeSessionManager.instance.activeSession!.user != null) {
if (CubeChatConnection.instance.isAuthenticated()) {
controller.inputElevatedButton.add(false);
Navigator.pushReplacementNamed(context, MainRoutes.main_page);
} else {
_loginToCubeChat(context, user, controller);
}
} else {
await createSession(user).then((cubeSession) {
CubeUser userss = CubeUser(
id: cubeSession.user?.id,
login: user.login,
password: user.password,
);
_loginToCubeChat(context, userss,controller);
}).catchError((exception) {
isChaking = false;
controller.inputElevatedButton.add(false);
errorMessage(context," ConnectyCube 11");
});
}
return isChaking;
}
void _loginToCubeChat(BuildContext context, CubeUser user,NumberController controller) {
CubeChatConnection.instance.login(user).then((cubeUser) {
SharedPrefs.saveNewUser(user);
controller.inputElevatedButton.add(false);
Navigator.pushReplacementNamed(context, MainRoutes.main_page);
}).catchError((exception) {
Navigator.pushReplacementNamed(context, MainRoutes.sign_in_page);
errorMessage(context," ConnectyCube 22");
});
}
Future<void> userSigUp({required BuildContext context, required CubeUser user, required NumberController controller}) async {
signUp(user).then((cubeUser) {
SharedPrefs.saveNewUser(user);
CubeUser userss = CubeUser(
id: cubeUser.id,
login: user.login,
password: user.password,
);
_loginToCubeChat(context, userss,controller);
})
.catchError((error){
controller.inputElevatedButton.add(false);
errorMessage(context, " ConnectyCube 33");
print(error);
});
}
Future<List<AppUsersModel>> getAppAllUsers() async {
List<AppUsersModel> appUsersModelList = [];
await getAllUsers().then((response) {
print("Shu yerda $response");
for(var item in response!.items){
usersForCall.add(item);
appUsersModelList.add(AppUsersModel(
user: UserModel(
fullName: item.fullName,
email: item.email,
login: item.login,
id: item.id,
avatar: item.avatar,
createdAt: item.createdAt?.toIso8601String(),
customData: item.customData,
externalId: item.externalId.toString(),
externalUserId: item.externalUserId.toString(),
facebookId: item.facebookId,
isGuest: item.isGuest.toString(),
lastRequestAt: item.lastRequestAt?.toIso8601String(),
phone: item.phone,
)
));
}
}).catchError((onError){
});
return appUsersModelList;
}
Future<void> getUserProfile(BuildContext context, String userLogin) async {
getUserByLogin(userLogin).then((cubeUser) {
AppUtils.cubeUser = cubeUser ?? CubeUser();
AppUtils.userModel = UserModel(
login: cubeUser?.login ?? "",
sId: cubeUser?.id.toString(),
phone: cubeUser?.phone ?? "",
lastRequestAt: cubeUser?.lastRequestAt?.toIso8601String() ?? "",
isGuest: cubeUser?.isGuest.toString(),
facebookId: cubeUser?.facebookId ?? "",
externalUserId: cubeUser?.externalUserId ?? "",
externalId: cubeUser?.externalId.toString(),
customData: cubeUser?.customData ?? "",
createdAt: cubeUser?.createdAt?.toIso8601String() ?? "",
avatar: cubeUser?.avatar ?? "",
id: cubeUser?.id,
email: cubeUser?.email ?? "",
fullName: cubeUser?.fullName ?? "",
timezone: cubeUser?.timeZone.toString() ?? "",
twitterId: cubeUser?.twitterId ?? "",
updatedAt: cubeUser?.updatedAt?.toIso8601String() ?? "",
website: cubeUser?.website.toString() ?? ""
);
})
.catchError((error) {
errorMessage(context," ConnectyCube 44");
});
}
Future<void> uploadAvatar({required BuildContext context, required File file}) async {
SharedPrefs.getUser().then((loggedUser) async {
await uploadFile(file, isPublic: false).then((cubeFile) {
loggedUser?.avatar = cubeFile.uid;
loggedUser?.fullName = AppUtils.userModel.fullName;
AppUtils.showSnackBar(context, "Image uploaded 👍");
return updateUser(loggedUser!);
})
.catchError((error) {
errorMessage(context, "Something went wrong");
});
});
}
Future<void> updateUserProfile(BuildContext context,CubeUser user) async {
await updateUser(user).then((updatedUser) {
AppUtils.cubeUser = updatedUser;
AppUtils.userModel = UserModel(
login: updatedUser.login ?? "",
sId: updatedUser.id.toString(),
phone: updatedUser.phone ?? "",
lastRequestAt: updatedUser.lastRequestAt?.toIso8601String() ?? "",
isGuest: updatedUser.isGuest.toString(),
facebookId: updatedUser.facebookId ?? "",
externalUserId: updatedUser.externalUserId ?? "",
externalId: updatedUser.externalId.toString(),
customData: updatedUser.customData ?? "",
createdAt: updatedUser.createdAt?.toIso8601String() ?? "",
avatar: updatedUser.avatar ?? "",
id: updatedUser.id,
email: updatedUser.email ?? "",
fullName: updatedUser.fullName ?? "",
timezone: updatedUser.timeZone.toString(),
twitterId: updatedUser.twitterId ?? "",
updatedAt: updatedUser.updatedAt?.toIso8601String() ?? "",
website: updatedUser.website.toString(),
);
AppUtils.showSnackBar(context, "The profile has been updated ✅");
}).catchError((error) {});
}
}
\ No newline at end of file
import '../src/utils/consts.dart';
import '../src/widgets/common.dart';
import 'package:connectycube_sdk/connectycube_chat.dart';
import 'package:flutter/material.dart';
class AddOccupantScreen extends StatefulWidget {
final CubeUser _cubeUser;
@override
State<StatefulWidget> createState() {
return _AddOccupantScreenState(_cubeUser);
}
AddOccupantScreen(this._cubeUser);
}
class _AddOccupantScreenState extends State<AddOccupantScreen> {
static const String TAG = "_AddOccupantScreenState";
final CubeUser currentUser;
_AddOccupantScreenState(this.currentUser);
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () => _onBackPressed(context),
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: true,
title: Text(
'Contacts',
),
),
body: BodyLayout(currentUser),
),
);
}
Future<bool> _onBackPressed(BuildContext context) {
Navigator.pop(context);
return Future.value(false);
}
}
class BodyLayout extends StatefulWidget {
final CubeUser currentUser;
BodyLayout(this.currentUser);
@override
State<StatefulWidget> createState() {
return _BodyLayoutState(currentUser);
}
}
class _BodyLayoutState extends State<BodyLayout> {
static const String TAG = "_BodyLayoutState";
final CubeUser currentUser;
List<CubeUser> userList = [];
Set<int> _selectedUsers = {};
var _isUsersContinues = false;
String? userToSearch;
String userMsg = " ";
_BodyLayoutState(this.currentUser);
_searchUser(value) {
log("searchUser _user= $value");
if (value != null)
setState(() {
userToSearch = value;
_isUsersContinues = true;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Column(
children: [
_buildTextFields(),
Container(
margin: EdgeInsets.only(left: 8),
child: Visibility(
maintainSize: false,
maintainAnimation: false,
maintainState: false,
visible: _isUsersContinues,
child: CircularProgressIndicator(
strokeWidth: 2,
),
),
),
Expanded(
child: _getUsersList(context),
),
],
)),
floatingActionButton: new Visibility(
visible: _selectedUsers.isNotEmpty,
child: FloatingActionButton(
heroTag: "Update dialog",
child: Icon(
Icons.check,
color: Colors.white,
),
backgroundColor: Colors.blue,
onPressed: () => _updateDialog(context, _selectedUsers.toList()),
),
),
);
}
Widget _buildTextFields() {
return new Container(
child: new Column(
children: <Widget>[
new Container(
child: new TextField(
autofocus: true,
textInputAction: TextInputAction.search,
decoration: new InputDecoration(labelText: 'Search users'),
onSubmitted: (value) {
_searchUser(value.trim());
}),
),
],
),
);
}
Widget _getUsersList(BuildContext context) {
clearValues() {
_isUsersContinues = false;
userToSearch = null;
userMsg = " ";
userList.clear();
}
if (_isUsersContinues) {
if (userToSearch != null && userToSearch!.isNotEmpty) {
getUsersByFullName(userToSearch!).then((users) {
log("getusers: $users", TAG);
setState(() {
clearValues();
userList.addAll(users!.items);
if (users.items.isEmpty) {
userMsg = "Couldn't find user";
}
});
}).catchError(
(onError) {
log("getusers catchError: $onError", TAG);
setState(() {
clearValues();
userMsg = "Couldn't find user";
});
},
);
}
}
if (userList.isEmpty)
return Center(
child: Text(
userMsg,
style: TextStyle(fontSize: 20),
),
);
else
return ListView.builder(
itemCount: userList.length,
itemBuilder: _getListItemTile,
);
}
Widget _getListItemTile(BuildContext context, int index) {
return Container(
child: TextButton(
child: Row(
children: <Widget>[
getUserAvatarWidget(userList[index], 30),
Flexible(
child: Container(
child: Column(
children: <Widget>[
Container(
child: Text(
'Name: ${userList[index].fullName}',
style: TextStyle(color: primaryColor),
),
alignment: Alignment.centerLeft,
margin: EdgeInsets.fromLTRB(10.0, 0.0, 0.0, 5.0),
),
],
),
margin: EdgeInsets.only(left: 20.0),
),
),
Container(
child: Checkbox(
value: _selectedUsers.contains(userList[index].id),
onChanged: ((checked) {
setState(() {
if (checked!) {
_selectedUsers.add(userList[index].id!);
} else {
_selectedUsers.remove(userList[index].id);
}
});
}),
),
),
],
),
onPressed: () {
setState(() {
if (_selectedUsers.contains(userList[index].id)) {
_selectedUsers.remove(userList[index].id);
} else {
_selectedUsers.add(userList[index].id!);
}
});
},
// color: greyColor2,
// padding: EdgeInsets.fromLTRB(25.0, 10.0, 25.0, 10.0),
// shape:
// RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
),
margin: EdgeInsets.only(bottom: 10.0, left: 5.0, right: 5.0),
);
}
void _updateDialog(BuildContext context, List<int> users) async {
log("_updateDialog with users= $users");
Navigator.pop(context, users);
}
}
This diff is collapsed.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:connectycube_sdk/connectycube_sdk.dart';
import 'package:vmeeting/src/select_dialog_screen.dart';
import 'chat_dialog_screen.dart';
const double DIALOGS_LIST_WIDTH = 300;
const double MIN_SCREEN_SIZE = 800;
const double DIVIDER_WIDTH = 1;
class ChatDialogResizableScreen extends StatelessWidget {
static const String TAG = "SelectDialogScreen";
final CubeUser currentUser;
final CubeDialog? selectedDialog;
ChatDialogResizableScreen(this.currentUser, this.selectedDialog);
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () => _onBackPressed(),
child: Scaffold(
body: BodyLayout(currentUser, selectedDialog),
),
);
}
Future<bool> _onBackPressed() {
return Future.value(true);
}
}
class BodyLayout extends StatefulWidget {
final CubeUser currentUser;
final CubeDialog? selectedDialog;
BodyLayout(this.currentUser, this.selectedDialog);
@override
State<StatefulWidget> createState() {
return _BodyLayoutState(currentUser, selectedDialog);
}
}
class _BodyLayoutState extends State<BodyLayout> {
static const String TAG = "_BodyLayoutState";
final CubeUser currentUser;
CubeDialog? selectedDialog;
_BodyLayoutState(this.currentUser, CubeDialog? selectedDialog) {
this.selectedDialog = selectedDialog;
}
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height,
child: Row(
children: [
if (isBigScreen || selectedDialog == null)
LayoutBuilder(builder: (context, constraint) {
var width = MediaQuery.of(context).size.width;
return SizedBox(
width: isBigScreen
? width / 4 <= DIALOGS_LIST_WIDTH
? DIALOGS_LIST_WIDTH
: width / 4
: width,
child: SelectDialogScreen(currentUser, selectedDialog,
(selectedDialog) {
setState(() {
this.selectedDialog = null;
Future.delayed(Duration(milliseconds: 50), () {
setState(() {
this.selectedDialog = selectedDialog;
});
});
});
}),
);
}),
Visibility(
visible: isBigScreen,
child: VerticalDivider(
width: DIVIDER_WIDTH,
),
),
getSelectedDialog()
],
),
);
}
Widget getSelectedDialog() {
if (selectedDialog != null) {
return Flexible(
child: Stack(
children: [
ChatDialogScreen(currentUser, selectedDialog!),
Align(
alignment: Alignment.topCenter,
child: SizedBox(
height: AppBar().preferredSize.height,
child: AppBar(
elevation: 0,
automaticallyImplyLeading: false,
leading: !isBigScreen && selectedDialog != null
? IconButton(
icon: Icon(Icons.arrow_back, color: Colors.white),
onPressed: () {
setState(() {
selectedDialog = null;
});
},
)
: null,
title: Text(
selectedDialog?.name ?? '',
),
centerTitle: false,
actions: <Widget>[
IconButton(
onPressed: () => showChatDetails(
context, currentUser, selectedDialog!),
icon: Icon(
Icons.info_outline,
color: Colors.white,
),
),
],
),
),
),
],
),
);
} else if (isBigScreen) {
return Expanded(
child: Container(
margin: EdgeInsets.only(top: AppBar().preferredSize.height),
child: Center(
child: Text(
'No dialog selected',
style: TextStyle(fontSize: 20),
),
),
),
);
} else {
return Container();
}
}
get isBigScreen => MediaQuery.of(context).size.width >= MIN_SCREEN_SIZE;
}
This diff is collapsed.
// 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';
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 ? ColorConst.appMainBackgroundColor : ColorConst.appSecondWhiteColor,
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 ? ColorConst.appMainBackgroundColor : ColorConst.appSecondWhiteColor,
iconTheme: IconThemeData(color: idDark ? ColorConst.appMainBackgroundColor : ColorConst.appBleckColor,)),
);
}
\ 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);
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);
static const Color iconColor = Color(0xff130F26);
static BorderRadius defaultBorderRadius = BorderRadius.all(Radius.circular(20));
}
\ 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<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;
final StreamController<List<int>> chackBoxController = StreamController<List<int>>.broadcast();
Sink<List<int>> get inputChackBox => chackBoxController.sink;
Stream<List<int>> get outputChackBox => chackBoxController.stream;
}
This diff is collapsed.
import 'package:connectycube_sdk/src/core/users/models/cube_user.dart';
import 'package:flutter/material.dart';
import 'package:vmeeting/src/utils/consts.dart';
import 'new_dialog_screen.dart';
import 'new_group_dialog_screen.dart';
import 'utils/route_utils.dart';
class CreateDialog extends StatelessWidget {
final CubeUser currentUser;
CreateDialog(this.currentUser);
@override
Widget build(BuildContext context) {
return Navigator(
key: Navigation.createDialogNavigation,
initialRoute: 'search_users',
onGenerateRoute: (RouteSettings settings) {
Map<String, dynamic>? args =
settings.arguments as Map<String, dynamic>?;
Widget page;
switch (settings.name) {
case 'search_users':
page = CreateChatScreen(currentUser);
break;
case 'configure_group_dialog':
page = NewGroupDialogScreen(
args![USER_ARG_NAME],
args[DIALOG_ARG_NAME],
args[SELECTED_USERS_ARG_NAME],
);
break;
default:
page = CreateChatScreen(args![USER_ARG_NAME]);
break;
}
return PageRouteBuilder(
pageBuilder: (_, __, ___) => page,
);
});
}
}
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:connectycube_sdk/connectycube_sdk.dart';
import 'managers/call_manager.dart';
class IncomingCallScreen extends StatelessWidget {
static const String TAG = "IncomingCallScreen";
final P2PSession _callSession;
IncomingCallScreen(this._callSession);
@override
Widget build(BuildContext context) {
_callSession.onSessionClosed = (callSession) {
log("_onSessionClosed", TAG);
Navigator.pop(context);
};
return WillPopScope(
onWillPop: () => _onBackPressed(context),
child: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(36),
child: Text(_getCallTitle(), style: const TextStyle(fontSize: 28)),
),
const Padding(
padding: EdgeInsets.only(top: 36, bottom: 8),
child: Text("Members:", style: TextStyle(fontSize: 20)),
),
Padding(
padding: const EdgeInsets.only(bottom: 86),
child: Text(_callSession.opponentsIds.join(", "),
style: const TextStyle(fontSize: 18)),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 36),
child: FloatingActionButton(
heroTag: "RejectCall",
backgroundColor: Colors.red,
onPressed: () => _rejectCall(context, _callSession),
child: const Icon(
Icons.call_end,
color: Colors.white,
),
),
),
Padding(
padding: const EdgeInsets.only(left: 36),
child: FloatingActionButton(
heroTag: "AcceptCall",
backgroundColor: Colors.green,
onPressed: () => _acceptCall(context, _callSession),
child: Icon(
Icons.call,
color: Colors.white,
),
),
),
],
),
],
),
)));
}
_getCallTitle() {
var callType;
switch (_callSession.callType) {
case CallType.VIDEO_CALL:
callType = "Video";
break;
case CallType.AUDIO_CALL:
callType = "Audio";
break;
}
return "Incoming $callType call";
}
void _acceptCall(BuildContext context, P2PSession callSession) {
CallManager.instance.acceptCall(callSession.sessionId, false);
}
void _rejectCall(BuildContext context, P2PSession callSession) {
CallManager.instance.reject(callSession.sessionId, false);
}
Future<bool> _onBackPressed(BuildContext context) {
return Future.value(false);
}
}
This diff is collapsed.
import 'package:connectycube_sdk/connectycube_sdk.dart';
import 'package:universal_io/io.dart';
import 'package:connectycube_flutter_call_kit/connectycube_flutter_call_kit.dart';
class CallKitManager {
static CallKitManager get instance => _getInstance();
static CallKitManager? _instance;
static String TAG = "CallKitManager";
static CallKitManager _getInstance() {
return _instance ??= CallKitManager._internal();
}
factory CallKitManager() => _getInstance();
CallKitManager._internal();
late Function(String uuid) onCallAccepted;
late Function(String uuid) onCallEnded;
late Function(bool mute, String uuid) onMuteCall;
init({
required onCallAccepted(uuid),
required onCallEnded(uuid),
required onMuteCall(mute, uuid),
}) {
this.onCallAccepted = onCallAccepted;
this.onCallEnded = onCallEnded;
this.onMuteCall = onMuteCall;
ConnectycubeFlutterCallKit.instance.init(
onCallAccepted: _onCallAccepted,
onCallRejected: _onCallRejected,
icon: Platform.isAndroid ? 'default_avatar' : 'CallkitIcon',
notificationIcon: 'ic_notification',
color: '#07711e',
ringtone:
Platform.isAndroid ? 'custom_ringtone' : 'custom_ringtone.caf');
if (Platform.isIOS) {
ConnectycubeFlutterCallKit.onCallMuted = _onCallMuted;
}
}
Future<void> processCallFinished(String uuid) async {
if(Platform.isAndroid || Platform.isIOS) {
ConnectycubeFlutterCallKit.reportCallEnded(sessionId: uuid);
ConnectycubeFlutterCallKit.setOnLockScreenVisibility(isVisible: false);
}
}
/// Event Listener Callbacks for 'connectycube_flutter_call_kit'
///
Future<void> _onCallMuted(bool mute, String uuid) async {
onMuteCall.call(mute, uuid);
}
void muteCall(String sessionId, bool mute) {
ConnectycubeFlutterCallKit.reportCallMuted(sessionId: sessionId, muted: mute);
}
Future<void> _onCallAccepted(CallEvent callEvent) async {
onCallAccepted.call(callEvent.sessionId);
}
Future<void> _onCallRejected(CallEvent callEvent) async {
if (!CubeChatConnection.instance.isAuthenticated()) {
rejectCall(
callEvent.sessionId, {...callEvent.opponentsIds, callEvent.callerId});
}
onCallEnded.call(callEvent.sessionId);
}
}
This diff is collapsed.
import 'dart:async';
import 'package:connectycube_sdk/connectycube_sdk.dart';
class ChatManager {
static ChatManager? _instance;
ChatManager._();
static ChatManager get instance => _instance ??= ChatManager._();
StreamController<CubeMessage> sentMessagesController =
StreamController.broadcast();
Stream<CubeMessage> get sentMessagesStream {
return sentMessagesController.stream;
}
StreamController<MessageStatus> readMessagesController =
StreamController.broadcast();
Stream<MessageStatus> get readMessagesStream {
return readMessagesController.stream;
}
}
This diff is collapsed.
This diff is collapsed.
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:flutter/material.dart';
import 'package:universal_io/io.dart';
import 'package:connectycube_sdk/connectycube_sdk.dart';
import 'utils/consts.dart';
import 'utils/pref_util.dart';
import 'utils/route_utils.dart';
const String PHONE_INPUT_ROUTE_NAME = 'PhoneInputScreen';
const String SMS_CODE_INPUT_ROUTE_NAME = 'SMSCodeInputScreen';
class VerifyPhoneNumber extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Navigator(
observers: [PhoneAuthRouteObserver(context)],
key: Navigation.verifyPhoneNavigation,
onGenerateRoute: (RouteSettings settings) {
return PageRouteBuilder(
reverseTransitionDuration:
Duration(milliseconds: Platform.isIOS ? 1000 : 300),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(0.0, 1.0);
const end = Offset.zero;
const curve = Curves.ease;
var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
settings: RouteSettings(name: PHONE_INPUT_ROUTE_NAME),
pageBuilder: (context, animation, secondaryAnimation) =>
PhoneInputScreen(
actions: [
SMSCodeRequestedAction((ctx1, action, flowKey, phoneNumber) {
Navigator.of(context).push(
MaterialPageRoute(
settings: RouteSettings(name: SMS_CODE_INPUT_ROUTE_NAME),
builder: (ctx2) => SMSCodeInputScreen(
flowKey: flowKey,
actions: [
AuthStateChangeAction<SignedIn>((ctx3, state) {
log('[AuthStateChangeAction] SignedIn');
state.user?.getIdToken().then((idToken) {
SharedPrefs.instance.saveLoginType(LoginType.phone);
Navigator.of(ctx3, rootNavigator: true)
.pushNamedAndRemoveUntil(
'login', (route) => false);
});
}),
AuthStateChangeAction<CredentialLinked>((ctx3, state) {
log('[AuthStateChangeAction] CredentialLinked');
state.user.getIdToken().then((idToken) {
SharedPrefs.instance.saveLoginType(LoginType.phone);
Navigator.of(ctx3, rootNavigator: true)
.pushNamedAndRemoveUntil(
'login', (route) => false);
});
}),
AuthStateChangeAction<Uninitialized>((ctx3, state) {
log('[AuthStateChangeAction] Uninitialized');
}),
AuthStateChangeAction<CredentialReceived>(
(ctx3, state) {
log('[AuthStateChangeAction] CredentialReceived');
}),
AuthStateChangeAction<AuthFailed>((ctx3, state) {
log('[AuthStateChangeAction] AuthFailed');
}),
AuthStateChangeAction<UserCreated>((ctx3, state) {
log('[AuthStateChangeAction] UserCreated');
state.credential.user?.getIdToken().then((idToken) {
SharedPrefs.instance.saveLoginType(LoginType.phone);
Navigator.of(ctx3, rootNavigator: true)
.pushNamedAndRemoveUntil(
'login', (route) => false);
});
}),
],
),
),
);
}),
],
),
);
},
);
}
}
class PhoneAuthRouteObserver extends RouteObserver {
final BuildContext context;
PhoneAuthRouteObserver(this.context);
@override
void didPop(Route route, Route? previousRoute) {
super.didPop(route, previousRoute);
if (route.settings.name == PHONE_INPUT_ROUTE_NAME) {
Navigator.of(context, rootNavigator: true).pop();
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import 'package:firebase_auth/firebase_auth.dart';
import 'package:connectycube_sdk/connectycube_sdk.dart';
import '../../firebase_options.dart';
Future<CubeSession> createPhoneAuthSession() async {
var phoneAuthIdToken = await FirebaseAuth.instance.currentUser?.getIdToken();
if (phoneAuthIdToken == null) {
return createSession();
}
return createSession().then((cubeSession) {
return signInUsingFirebase(
DefaultFirebaseOptions.currentPlatform.projectId,
phoneAuthIdToken,
).then((_) {
return CubeSessionManager.instance.activeSession!;
});
});
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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