Merge branch 'ios_issues' into 'master'
fix ios issues See merge request Cloud_Solution/diplomatic-quarter!70merge-requests/225/head
commit
d90a28aecf
@ -1,87 +0,0 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
platform :ios, '9.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
project 'Runner', {
|
||||
'Debug' => :debug,
|
||||
'Profile' => :release,
|
||||
'Release' => :release,
|
||||
}
|
||||
|
||||
def parse_KV_file(file, separator='=')
|
||||
file_abs_path = File.expand_path(file)
|
||||
if !File.exists? file_abs_path
|
||||
return [];
|
||||
end
|
||||
generated_key_values = {}
|
||||
skip_line_start_symbols = ["#", "/"]
|
||||
File.foreach(file_abs_path) do |line|
|
||||
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
|
||||
plugin = line.split(pattern=separator)
|
||||
if plugin.length == 2
|
||||
podname = plugin[0].strip()
|
||||
path = plugin[1].strip()
|
||||
podpath = File.expand_path("#{path}", file_abs_path)
|
||||
generated_key_values[podname] = podpath
|
||||
else
|
||||
puts "Invalid plugin specification: #{line}"
|
||||
end
|
||||
end
|
||||
generated_key_values
|
||||
end
|
||||
|
||||
target 'Runner' do
|
||||
use_frameworks!
|
||||
use_modular_headers!
|
||||
|
||||
# Flutter Pod
|
||||
|
||||
copied_flutter_dir = File.join(__dir__, 'Flutter')
|
||||
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
|
||||
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
|
||||
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
|
||||
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
|
||||
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
|
||||
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
|
||||
|
||||
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
|
||||
unless File.exist?(generated_xcode_build_settings_path)
|
||||
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
||||
end
|
||||
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
|
||||
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
|
||||
|
||||
unless File.exist?(copied_framework_path)
|
||||
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
|
||||
end
|
||||
unless File.exist?(copied_podspec_path)
|
||||
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
|
||||
end
|
||||
end
|
||||
|
||||
# Keep pod path relative so it can be checked into Podfile.lock.
|
||||
pod 'Flutter', :path => 'Flutter'
|
||||
|
||||
# Plugin Pods
|
||||
|
||||
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
||||
# referring to absolute paths on developers' machines.
|
||||
system('rm -rf .symlinks')
|
||||
system('mkdir -p .symlinks/plugins')
|
||||
plugin_pods = parse_KV_file('../.flutter-plugins')
|
||||
plugin_pods.each do |name, path|
|
||||
symlink = File.join('.symlinks', 'plugins', name)
|
||||
File.symlink(path, symlink)
|
||||
pod name, :path => File.join(symlink, 'ios')
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1,310 +0,0 @@
|
||||
PODS:
|
||||
- barcode_scan (0.0.1):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner
|
||||
- SwiftProtobuf
|
||||
- connectivity (0.0.1):
|
||||
- Flutter
|
||||
- Reachability
|
||||
- connectivity_for_web (0.1.0):
|
||||
- Flutter
|
||||
- connectivity_macos (0.0.1):
|
||||
- Flutter
|
||||
- device_info (0.0.1):
|
||||
- Flutter
|
||||
- Firebase/Core (6.23.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseAnalytics (= 6.4.2)
|
||||
- Firebase/CoreOnly (6.23.0):
|
||||
- FirebaseCore (= 6.6.7)
|
||||
- Firebase/Messaging (6.23.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseMessaging (~> 4.3.1)
|
||||
- firebase_messaging (0.0.1):
|
||||
- Firebase/Core
|
||||
- Firebase/Messaging
|
||||
- Flutter
|
||||
- FirebaseAnalytics (6.4.2):
|
||||
- FirebaseCore (~> 6.6)
|
||||
- FirebaseInstallations (~> 1.2)
|
||||
- GoogleAppMeasurement (= 6.4.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 6.0)
|
||||
- GoogleUtilities/Network (~> 6.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 6.0)"
|
||||
- nanopb (= 0.3.9011)
|
||||
- FirebaseAnalyticsInterop (1.5.0)
|
||||
- FirebaseCore (6.6.7):
|
||||
- FirebaseCoreDiagnostics (~> 1.2)
|
||||
- FirebaseCoreDiagnosticsInterop (~> 1.2)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/Logger (~> 6.5)
|
||||
- FirebaseCoreDiagnostics (1.2.4):
|
||||
- FirebaseCoreDiagnosticsInterop (~> 1.2)
|
||||
- GoogleDataTransportCCTSupport (~> 3.0)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/Logger (~> 6.5)
|
||||
- nanopb (~> 0.3.901)
|
||||
- FirebaseCoreDiagnosticsInterop (1.2.0)
|
||||
- FirebaseInstallations (1.2.0):
|
||||
- FirebaseCore (~> 6.6)
|
||||
- GoogleUtilities/Environment (~> 6.6)
|
||||
- GoogleUtilities/UserDefaults (~> 6.6)
|
||||
- PromisesObjC (~> 1.2)
|
||||
- FirebaseInstanceID (4.3.4):
|
||||
- FirebaseCore (~> 6.6)
|
||||
- FirebaseInstallations (~> 1.0)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/UserDefaults (~> 6.5)
|
||||
- FirebaseMessaging (4.3.1):
|
||||
- FirebaseAnalyticsInterop (~> 1.5)
|
||||
- FirebaseCore (~> 6.6)
|
||||
- FirebaseInstanceID (~> 4.3)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.5)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/Reachability (~> 6.5)
|
||||
- GoogleUtilities/UserDefaults (~> 6.5)
|
||||
- Protobuf (>= 3.9.2, ~> 3.9)
|
||||
- Flutter (1.0.0)
|
||||
- flutter_flexible_toast (0.0.1):
|
||||
- Flutter
|
||||
- flutter_inappwebview (0.0.1):
|
||||
- Flutter
|
||||
- flutter_local_notifications (0.0.1):
|
||||
- Flutter
|
||||
- flutter_plugin_android_lifecycle (0.0.1):
|
||||
- Flutter
|
||||
- GoogleAppMeasurement (6.4.2):
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 6.0)
|
||||
- GoogleUtilities/Network (~> 6.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 6.0)"
|
||||
- nanopb (= 0.3.9011)
|
||||
- GoogleDataTransport (6.0.0)
|
||||
- GoogleDataTransportCCTSupport (3.0.0):
|
||||
- GoogleDataTransport (~> 6.0)
|
||||
- nanopb (~> 0.3.901)
|
||||
- GoogleUtilities/AppDelegateSwizzler (6.6.0):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Environment (6.6.0):
|
||||
- PromisesObjC (~> 1.2)
|
||||
- GoogleUtilities/Logger (6.6.0):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/MethodSwizzler (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (6.6.0)"
|
||||
- GoogleUtilities/Reachability (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/UserDefaults (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- hexcolor (0.0.1):
|
||||
- Flutter
|
||||
- image_cropper (0.0.2):
|
||||
- Flutter
|
||||
- TOCropViewController (~> 2.5.2)
|
||||
- image_picker (0.0.1):
|
||||
- Flutter
|
||||
- local_auth (0.0.1):
|
||||
- Flutter
|
||||
- manage_calendar_events (0.0.1):
|
||||
- Flutter
|
||||
- map_launcher (0.0.1):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner (5.0.11)
|
||||
- nanopb (0.3.9011):
|
||||
- nanopb/decode (= 0.3.9011)
|
||||
- nanopb/encode (= 0.3.9011)
|
||||
- nanopb/decode (0.3.9011)
|
||||
- nanopb/encode (0.3.9011)
|
||||
- path_provider_linux (0.0.1):
|
||||
- Flutter
|
||||
- "permission_handler (5.0.1+1)":
|
||||
- Flutter
|
||||
- PromisesObjC (1.2.8)
|
||||
- Protobuf (3.11.4)
|
||||
- Reachability (3.2)
|
||||
- shared_preferences (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_linux (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_macos (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_web (0.0.1):
|
||||
- Flutter
|
||||
- SwiftProtobuf (1.10.2)
|
||||
- TOCropViewController (2.5.4)
|
||||
- url_launcher (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_linux (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_macos (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_web (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
|
||||
- connectivity (from `.symlinks/plugins/connectivity/ios`)
|
||||
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
|
||||
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
|
||||
- device_info (from `.symlinks/plugins/device_info/ios`)
|
||||
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`)
|
||||
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
|
||||
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
||||
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
|
||||
- hexcolor (from `.symlinks/plugins/hexcolor/ios`)
|
||||
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
|
||||
- image_picker (from `.symlinks/plugins/image_picker/ios`)
|
||||
- local_auth (from `.symlinks/plugins/local_auth/ios`)
|
||||
- manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`)
|
||||
- map_launcher (from `.symlinks/plugins/map_launcher/ios`)
|
||||
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
|
||||
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
|
||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
|
||||
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
|
||||
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
|
||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
|
||||
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
|
||||
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- Firebase
|
||||
- FirebaseAnalytics
|
||||
- FirebaseAnalyticsInterop
|
||||
- FirebaseCore
|
||||
- FirebaseCoreDiagnostics
|
||||
- FirebaseCoreDiagnosticsInterop
|
||||
- FirebaseInstallations
|
||||
- FirebaseInstanceID
|
||||
- FirebaseMessaging
|
||||
- GoogleAppMeasurement
|
||||
- GoogleDataTransport
|
||||
- GoogleDataTransportCCTSupport
|
||||
- GoogleUtilities
|
||||
- MTBBarcodeScanner
|
||||
- nanopb
|
||||
- PromisesObjC
|
||||
- Protobuf
|
||||
- Reachability
|
||||
- SwiftProtobuf
|
||||
- TOCropViewController
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
barcode_scan:
|
||||
:path: ".symlinks/plugins/barcode_scan/ios"
|
||||
connectivity:
|
||||
:path: ".symlinks/plugins/connectivity/ios"
|
||||
connectivity_for_web:
|
||||
:path: ".symlinks/plugins/connectivity_for_web/ios"
|
||||
connectivity_macos:
|
||||
:path: ".symlinks/plugins/connectivity_macos/ios"
|
||||
device_info:
|
||||
:path: ".symlinks/plugins/device_info/ios"
|
||||
firebase_messaging:
|
||||
:path: ".symlinks/plugins/firebase_messaging/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_flexible_toast:
|
||||
:path: ".symlinks/plugins/flutter_flexible_toast/ios"
|
||||
flutter_inappwebview:
|
||||
:path: ".symlinks/plugins/flutter_inappwebview/ios"
|
||||
flutter_local_notifications:
|
||||
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
||||
flutter_plugin_android_lifecycle:
|
||||
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
|
||||
hexcolor:
|
||||
:path: ".symlinks/plugins/hexcolor/ios"
|
||||
image_cropper:
|
||||
:path: ".symlinks/plugins/image_cropper/ios"
|
||||
image_picker:
|
||||
:path: ".symlinks/plugins/image_picker/ios"
|
||||
local_auth:
|
||||
:path: ".symlinks/plugins/local_auth/ios"
|
||||
manage_calendar_events:
|
||||
:path: ".symlinks/plugins/manage_calendar_events/ios"
|
||||
map_launcher:
|
||||
:path: ".symlinks/plugins/map_launcher/ios"
|
||||
path_provider_linux:
|
||||
:path: ".symlinks/plugins/path_provider_linux/ios"
|
||||
permission_handler:
|
||||
:path: ".symlinks/plugins/permission_handler/ios"
|
||||
shared_preferences:
|
||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||
shared_preferences_linux:
|
||||
:path: ".symlinks/plugins/shared_preferences_linux/ios"
|
||||
shared_preferences_macos:
|
||||
:path: ".symlinks/plugins/shared_preferences_macos/ios"
|
||||
shared_preferences_web:
|
||||
:path: ".symlinks/plugins/shared_preferences_web/ios"
|
||||
url_launcher:
|
||||
:path: ".symlinks/plugins/url_launcher/ios"
|
||||
url_launcher_linux:
|
||||
:path: ".symlinks/plugins/url_launcher_linux/ios"
|
||||
url_launcher_macos:
|
||||
:path: ".symlinks/plugins/url_launcher_macos/ios"
|
||||
url_launcher_web:
|
||||
:path: ".symlinks/plugins/url_launcher_web/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479
|
||||
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
|
||||
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
|
||||
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
|
||||
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
|
||||
Firebase: 585ae467b3edda6a5444e788fda6888f024d8d6f
|
||||
firebase_messaging: 21344b3b3a7d9d325d63a70e3750c0c798fe1e03
|
||||
FirebaseAnalytics: 558f7a03d19de451093032c806f39d5f9dff096e
|
||||
FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae
|
||||
FirebaseCore: a2788a0d5f6c1dff17b8f79b4a73654a8d4bfdbd
|
||||
FirebaseCoreDiagnostics: b59c024493a409f8aecba02c99928d0d8431d159
|
||||
FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850
|
||||
FirebaseInstallations: 2119fb3e46b0a88bfdbf12562f855ee3252462fa
|
||||
FirebaseInstanceID: cef67c4967c7cecb56ea65d8acbb4834825c587b
|
||||
FirebaseMessaging: 828e66eb357a893e3cebd9ee0f6bc1941447cc94
|
||||
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
||||
flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143
|
||||
flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189
|
||||
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
|
||||
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
|
||||
GoogleAppMeasurement: 2253e99c1f22638cf234c059144660c338ad76c3
|
||||
GoogleDataTransport: 061fe7d9b476710e3cd8ea51e8e07d8b67c2b420
|
||||
GoogleDataTransportCCTSupport: 0f39025e8cf51f168711bd3fb773938d7e62ddb5
|
||||
GoogleUtilities: 39530bc0ad980530298e9c4af8549e991fd033b1
|
||||
hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
|
||||
image_cropper: 3c16d7651730ffe85897f5a1c4e2547e6b54989a
|
||||
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
|
||||
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
|
||||
manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34
|
||||
map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
|
||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||
nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd
|
||||
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
|
||||
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
|
||||
PromisesObjC: c119f3cd559f50b7ae681fa59dc1acd19173b7e6
|
||||
Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7
|
||||
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
|
||||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
||||
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
|
||||
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
|
||||
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
|
||||
SwiftProtobuf: bec1ae7d686ff73dd09d79866154f4970b891410
|
||||
TOCropViewController: 2a1ae1242600b1f2d996fd91a5268b2309a33b5c
|
||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
|
||||
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
|
||||
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
|
||||
|
||||
PODFILE CHECKSUM: 2609452b760cd11039b14039a86564367a3d8ab9
|
||||
|
||||
COCOAPODS: 1.9.1
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -0,0 +1,13 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
|
||||
@UIApplicationMain
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
@ -1,388 +1,388 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/conference/conference_button_bar.dart';
|
||||
import 'package:diplomaticquarterapp/pages/conference/conference_room.dart';
|
||||
import 'package:diplomaticquarterapp/pages/conference/draggable_publisher.dart';
|
||||
import 'package:diplomaticquarterapp/pages/conference/participant_widget.dart';
|
||||
import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart';
|
||||
import 'package:diplomaticquarterapp/pages/conference/widgets/platform_alert_dialog.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:wakelock/wakelock.dart';
|
||||
|
||||
class ConferencePage extends StatefulWidget {
|
||||
final RoomModel roomModel;
|
||||
|
||||
const ConferencePage({Key key, this.roomModel}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ConferencePageState createState() => _ConferencePageState();
|
||||
}
|
||||
|
||||
class _ConferencePageState extends State<ConferencePage> {
|
||||
final StreamController<bool> _onButtonBarVisibleStreamController = StreamController<bool>.broadcast();
|
||||
final StreamController<double> _onButtonBarHeightStreamController = StreamController<double>.broadcast();
|
||||
ConferenceRoom _conferenceRoom;
|
||||
StreamSubscription _onConferenceRoomException;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_lockInPortrait();
|
||||
_connectToRoom();
|
||||
_wakeLock(true);
|
||||
}
|
||||
|
||||
void _connectToRoom() async {
|
||||
try {
|
||||
final conferenceRoom = ConferenceRoom(
|
||||
name: widget.roomModel.name,
|
||||
token: widget.roomModel.token,
|
||||
identity: widget.roomModel.identity,
|
||||
);
|
||||
await conferenceRoom.connect();
|
||||
setState(() {
|
||||
_conferenceRoom = conferenceRoom;
|
||||
_onConferenceRoomException = _conferenceRoom.onException.listen((err) async {
|
||||
await PlatformAlertDialog(
|
||||
title: err is PlatformException ? err.message : 'An error occured',
|
||||
content: err is PlatformException ? err.details : err.toString(),
|
||||
defaultActionText: 'OK',
|
||||
).show(context);
|
||||
});
|
||||
_conferenceRoom.addListener(_conferenceRoomUpdated);
|
||||
});
|
||||
} catch (err) {
|
||||
print(err);
|
||||
await PlatformAlertDialog(
|
||||
title: err is PlatformException ? err.message : 'An error occured',
|
||||
content: err is PlatformException ? err.details : err.toString(),
|
||||
defaultActionText: 'OK',
|
||||
).show(context);
|
||||
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _lockInPortrait() async {
|
||||
await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_freePortraitLock();
|
||||
_wakeLock(false);
|
||||
_disposeStreamsAndSubscriptions();
|
||||
if (_conferenceRoom != null) _conferenceRoom.removeListener(_conferenceRoomUpdated);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _freePortraitLock() async {
|
||||
await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
|
||||
DeviceOrientation.landscapeRight,
|
||||
DeviceOrientation.landscapeLeft,
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
}
|
||||
|
||||
Future<void> _disposeStreamsAndSubscriptions() async {
|
||||
if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close();
|
||||
if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close();
|
||||
if (_onConferenceRoomException != null) await _onConferenceRoomException.cancel();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
body: _conferenceRoom == null ? showProgress() : buildLayout(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LayoutBuilder buildLayout() {
|
||||
return LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
_buildParticipants(context, constraints.biggest, _conferenceRoom),
|
||||
ConferenceButtonBar(
|
||||
audioEnabled: _conferenceRoom.onAudioEnabled,
|
||||
videoEnabled: _conferenceRoom.onVideoEnabled,
|
||||
onAudioEnabled: _conferenceRoom.toggleAudioEnabled,
|
||||
onVideoEnabled: _conferenceRoom.toggleVideoEnabled,
|
||||
onHangup: _onHangup,
|
||||
onSwitchCamera: _conferenceRoom.switchCamera,
|
||||
onPersonAdd: _onPersonAdd,
|
||||
onPersonRemove: _onPersonRemove,
|
||||
onHeight: _onHeightBar,
|
||||
onShow: _onShowBar,
|
||||
onHide: _onHideBar,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget showProgress() {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Center(child: CircularProgressIndicator()),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
'Connecting to the call...',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _onHangup() async {
|
||||
print('onHangup');
|
||||
await _conferenceRoom.disconnect();
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
void _onPersonAdd() {
|
||||
print('onPersonAdd');
|
||||
try {
|
||||
_conferenceRoom.addDummy(
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
const Placeholder(),
|
||||
Center(
|
||||
child: Text(
|
||||
(_conferenceRoom.participants.length + 1).toString(),
|
||||
style: const TextStyle(
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
blurRadius: 3.0,
|
||||
color: Color.fromARGB(255, 0, 0, 0),
|
||||
),
|
||||
Shadow(
|
||||
blurRadius: 8.0,
|
||||
color: Color.fromARGB(255, 255, 255, 255),
|
||||
),
|
||||
],
|
||||
fontSize: 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
} on PlatformException catch (err) {
|
||||
PlatformAlertDialog(
|
||||
title: err.message,
|
||||
content: err.details,
|
||||
defaultActionText: 'OK',
|
||||
).show(context);
|
||||
}
|
||||
}
|
||||
|
||||
void _onPersonRemove() {
|
||||
print('onPersonRemove');
|
||||
_conferenceRoom.removeDummy();
|
||||
}
|
||||
|
||||
Widget _buildParticipants(BuildContext context, Size size, ConferenceRoom conferenceRoom) {
|
||||
final children = <Widget>[];
|
||||
final length = conferenceRoom.participants.length;
|
||||
|
||||
if (length <= 2) {
|
||||
_buildOverlayLayout(context, size, children);
|
||||
return Stack(children: children);
|
||||
}
|
||||
|
||||
void buildInCols(bool removeLocalBeforeChunking, bool moveLastOfEachRowToNextRow, int columns) {
|
||||
_buildLayoutInGrid(
|
||||
context,
|
||||
size,
|
||||
children,
|
||||
removeLocalBeforeChunking: removeLocalBeforeChunking,
|
||||
moveLastOfEachRowToNextRow: moveLastOfEachRowToNextRow,
|
||||
columns: columns,
|
||||
);
|
||||
}
|
||||
|
||||
// if (length <= 3) {
|
||||
// buildInCols(true, false, 1);
|
||||
// } else if (length == 5) {
|
||||
// buildInCols(false, true, 2);
|
||||
// } else if (length <= 6 || length == 8) {
|
||||
// buildInCols(false, false, 2);
|
||||
// } else if (length == 7 || length == 9) {
|
||||
// buildInCols(true, false, 2);
|
||||
// } else if (length == 10) {
|
||||
// buildInCols(false, true, 3);
|
||||
// } else if (length == 13 || length == 16) {
|
||||
// buildInCols(true, false, 3);
|
||||
// } else if (length <= 18) {
|
||||
// buildInCols(false, false, 3);
|
||||
// }
|
||||
|
||||
return Column(
|
||||
children: children,
|
||||
);
|
||||
}
|
||||
|
||||
void _buildOverlayLayout(BuildContext context, Size size, List<Widget> children) {
|
||||
final participants = _conferenceRoom.participants;
|
||||
if (participants.length == 1) {
|
||||
children.add(_buildNoiseBox());
|
||||
} else {
|
||||
final remoteParticipant = participants.firstWhere((ParticipantWidget participant) => participant.isRemote, orElse: () => null);
|
||||
if (remoteParticipant != null) {
|
||||
children.add(remoteParticipant);
|
||||
}
|
||||
}
|
||||
|
||||
final localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null);
|
||||
if (localParticipant != null) {
|
||||
children.add(DraggablePublisher(
|
||||
key: Key('publisher'),
|
||||
child: localParticipant,
|
||||
availableScreenSize: size,
|
||||
onButtonBarVisible: _onButtonBarVisibleStreamController.stream,
|
||||
onButtonBarHeight: _onButtonBarHeightStreamController.stream,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
void _buildLayoutInGrid(
|
||||
BuildContext context,
|
||||
Size size,
|
||||
List<Widget> children, {
|
||||
bool removeLocalBeforeChunking = false,
|
||||
bool moveLastOfEachRowToNextRow = false,
|
||||
int columns = 2,
|
||||
}) {
|
||||
final participants = _conferenceRoom.participants;
|
||||
ParticipantWidget localParticipant;
|
||||
if (removeLocalBeforeChunking) {
|
||||
localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null);
|
||||
if (localParticipant != null) {
|
||||
participants.remove(localParticipant);
|
||||
}
|
||||
}
|
||||
final chunkedParticipants = chunk(array: participants, size: columns);
|
||||
if (localParticipant != null) {
|
||||
chunkedParticipants.last.add(localParticipant);
|
||||
participants.add(localParticipant);
|
||||
}
|
||||
|
||||
if (moveLastOfEachRowToNextRow) {
|
||||
for (var i = 0; i < chunkedParticipants.length - 1; i++) {
|
||||
var participant = chunkedParticipants[i].removeLast();
|
||||
chunkedParticipants[i + 1].insert(0, participant);
|
||||
}
|
||||
}
|
||||
|
||||
for (final participantChunk in chunkedParticipants) {
|
||||
final rowChildren = <Widget>[];
|
||||
for (final participant in participantChunk) {
|
||||
rowChildren.add(
|
||||
Container(
|
||||
width: size.width / participantChunk.length,
|
||||
height: size.height / chunkedParticipants.length,
|
||||
child: participant,
|
||||
),
|
||||
);
|
||||
}
|
||||
children.add(
|
||||
Container(
|
||||
height: size.height / chunkedParticipants.length,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: rowChildren,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
NoiseBox _buildNoiseBox() {
|
||||
return NoiseBox(
|
||||
density: NoiseBoxDensity.xLow,
|
||||
backgroundColor: Colors.grey.shade900,
|
||||
child: Center(
|
||||
child: Container(
|
||||
color: Colors.black54,
|
||||
width: double.infinity,
|
||||
height: 40,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Waiting for another participant to connect to the call...',
|
||||
key: Key('text-wait'),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<List<T>> chunk<T>({@required List<T> array, @required int size}) {
|
||||
final result = <List<T>>[];
|
||||
if (array.isEmpty || size <= 0) {
|
||||
return result;
|
||||
}
|
||||
var first = 0;
|
||||
var last = size;
|
||||
final totalLoop = array.length % size == 0 ? array.length ~/ size : array.length ~/ size + 1;
|
||||
for (var i = 0; i < totalLoop; i++) {
|
||||
if (last > array.length) {
|
||||
result.add(array.sublist(first, array.length));
|
||||
} else {
|
||||
result.add(array.sublist(first, last));
|
||||
}
|
||||
first = last;
|
||||
last = last + size;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void _onHeightBar(double height) {
|
||||
_onButtonBarHeightStreamController.add(height);
|
||||
}
|
||||
|
||||
void _onShowBar() {
|
||||
setState(() {
|
||||
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
|
||||
});
|
||||
_onButtonBarVisibleStreamController.add(true);
|
||||
}
|
||||
|
||||
void _onHideBar() {
|
||||
setState(() {
|
||||
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
|
||||
});
|
||||
_onButtonBarVisibleStreamController.add(false);
|
||||
}
|
||||
|
||||
Future<void> _wakeLock(bool enable) async {
|
||||
try {
|
||||
return await (enable ? Wakelock.enable() : Wakelock.disable());
|
||||
} catch (err) {
|
||||
print('Unable to change the Wakelock and set it to $enable');
|
||||
print(err);
|
||||
}
|
||||
}
|
||||
|
||||
void _conferenceRoomUpdated() {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
// import 'dart:async';
|
||||
//
|
||||
// import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart';
|
||||
// import 'package:diplomaticquarterapp/pages/conference/conference_button_bar.dart';
|
||||
// import 'package:diplomaticquarterapp/pages/conference/conference_room.dart';
|
||||
// import 'package:diplomaticquarterapp/pages/conference/draggable_publisher.dart';
|
||||
// import 'package:diplomaticquarterapp/pages/conference/participant_widget.dart';
|
||||
// import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart';
|
||||
// import 'package:diplomaticquarterapp/pages/conference/widgets/platform_alert_dialog.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter/services.dart';
|
||||
// import 'package:wakelock/wakelock.dart';
|
||||
//
|
||||
// class ConferencePage extends StatefulWidget {
|
||||
// final RoomModel roomModel;
|
||||
//
|
||||
// const ConferencePage({Key key, this.roomModel}) : super(key: key);
|
||||
//
|
||||
// @override
|
||||
// _ConferencePageState createState() => _ConferencePageState();
|
||||
// }
|
||||
//
|
||||
// class _ConferencePageState extends State<ConferencePage> {
|
||||
// final StreamController<bool> _onButtonBarVisibleStreamController = StreamController<bool>.broadcast();
|
||||
// final StreamController<double> _onButtonBarHeightStreamController = StreamController<double>.broadcast();
|
||||
// ConferenceRoom _conferenceRoom;
|
||||
// StreamSubscription _onConferenceRoomException;
|
||||
//
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// _lockInPortrait();
|
||||
// // _connectToRoom();
|
||||
// _wakeLock(true);
|
||||
// }
|
||||
//
|
||||
// // void _connectToRoom() async {
|
||||
// // try {
|
||||
// // final conferenceRoom = ConferenceRoom(
|
||||
// // name: widget.roomModel.name,
|
||||
// // token: widget.roomModel.token,
|
||||
// // identity: widget.roomModel.identity,
|
||||
// // );
|
||||
// // await conferenceRoom.connect();
|
||||
// // setState(() {
|
||||
// // _conferenceRoom = conferenceRoom;
|
||||
// // _onConferenceRoomException = _conferenceRoom.onException.listen((err) async {
|
||||
// // await PlatformAlertDialog(
|
||||
// // title: err is PlatformException ? err.message : 'An error occured',
|
||||
// // content: err is PlatformException ? err.details : err.toString(),
|
||||
// // defaultActionText: 'OK',
|
||||
// // ).show(context);
|
||||
// // });
|
||||
// // _conferenceRoom.addListener(_conferenceRoomUpdated);
|
||||
// // });
|
||||
// // } catch (err) {
|
||||
// // print(err);
|
||||
// // await PlatformAlertDialog(
|
||||
// // title: err is PlatformException ? err.message : 'An error occured',
|
||||
// // content: err is PlatformException ? err.details : err.toString(),
|
||||
// // defaultActionText: 'OK',
|
||||
// // ).show(context);
|
||||
// //
|
||||
// // Navigator.of(context).pop();
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// Future<void> _lockInPortrait() async {
|
||||
// await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
|
||||
// DeviceOrientation.portraitUp,
|
||||
// DeviceOrientation.portraitDown,
|
||||
// ]);
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _freePortraitLock();
|
||||
// _wakeLock(false);
|
||||
// _disposeStreamsAndSubscriptions();
|
||||
// if (_conferenceRoom != null) _conferenceRoom.removeListener(_conferenceRoomUpdated);
|
||||
// super.dispose();
|
||||
// }
|
||||
//
|
||||
// Future<void> _freePortraitLock() async {
|
||||
// await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
|
||||
// DeviceOrientation.landscapeRight,
|
||||
// DeviceOrientation.landscapeLeft,
|
||||
// DeviceOrientation.portraitUp,
|
||||
// DeviceOrientation.portraitDown,
|
||||
// ]);
|
||||
// }
|
||||
//
|
||||
// Future<void> _disposeStreamsAndSubscriptions() async {
|
||||
// if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close();
|
||||
// if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close();
|
||||
// if (_onConferenceRoomException != null) await _onConferenceRoomException.cancel();
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return WillPopScope(
|
||||
// onWillPop: () async => false,
|
||||
// child: Scaffold(
|
||||
// backgroundColor: Colors.black,
|
||||
// body: _conferenceRoom == null ? showProgress() : buildLayout(),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// LayoutBuilder buildLayout() {
|
||||
// return LayoutBuilder(
|
||||
// builder: (BuildContext context, BoxConstraints constraints) {
|
||||
// return Stack(
|
||||
// children: <Widget>[
|
||||
// _buildParticipants(context, constraints.biggest, _conferenceRoom),
|
||||
// ConferenceButtonBar(
|
||||
// audioEnabled: _conferenceRoom.onAudioEnabled,
|
||||
// videoEnabled: _conferenceRoom.onVideoEnabled,
|
||||
// onAudioEnabled: _conferenceRoom.toggleAudioEnabled,
|
||||
// onVideoEnabled: _conferenceRoom.toggleVideoEnabled,
|
||||
// onHangup: _onHangup,
|
||||
// onSwitchCamera: _conferenceRoom.switchCamera,
|
||||
// onPersonAdd: _onPersonAdd,
|
||||
// onPersonRemove: _onPersonRemove,
|
||||
// onHeight: _onHeightBar,
|
||||
// onShow: _onShowBar,
|
||||
// onHide: _onHideBar,
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// Widget showProgress() {
|
||||
// return Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: <Widget>[
|
||||
// Center(child: CircularProgressIndicator()),
|
||||
// SizedBox(
|
||||
// height: 10,
|
||||
// ),
|
||||
// Text(
|
||||
// 'Connecting to the call...',
|
||||
// style: TextStyle(color: Colors.white),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// Future<void> _onHangup() async {
|
||||
// print('onHangup');
|
||||
// await _conferenceRoom.disconnect();
|
||||
// Navigator.of(context).pop();
|
||||
// }
|
||||
//
|
||||
// void _onPersonAdd() {
|
||||
// print('onPersonAdd');
|
||||
// try {
|
||||
// _conferenceRoom.addDummy(
|
||||
// child: Stack(
|
||||
// children: <Widget>[
|
||||
// const Placeholder(),
|
||||
// Center(
|
||||
// child: Text(
|
||||
// (_conferenceRoom.participants.length + 1).toString(),
|
||||
// style: const TextStyle(
|
||||
// shadows: <Shadow>[
|
||||
// Shadow(
|
||||
// blurRadius: 3.0,
|
||||
// color: Color.fromARGB(255, 0, 0, 0),
|
||||
// ),
|
||||
// Shadow(
|
||||
// blurRadius: 8.0,
|
||||
// color: Color.fromARGB(255, 255, 255, 255),
|
||||
// ),
|
||||
// ],
|
||||
// fontSize: 80,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// } on PlatformException catch (err) {
|
||||
// PlatformAlertDialog(
|
||||
// title: err.message,
|
||||
// content: err.details,
|
||||
// defaultActionText: 'OK',
|
||||
// ).show(context);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// void _onPersonRemove() {
|
||||
// print('onPersonRemove');
|
||||
// _conferenceRoom.removeDummy();
|
||||
// }
|
||||
//
|
||||
// Widget _buildParticipants(BuildContext context, Size size, ConferenceRoom conferenceRoom) {
|
||||
// final children = <Widget>[];
|
||||
// final length = conferenceRoom.participants.length;
|
||||
//
|
||||
// if (length <= 2) {
|
||||
// _buildOverlayLayout(context, size, children);
|
||||
// return Stack(children: children);
|
||||
// }
|
||||
//
|
||||
// void buildInCols(bool removeLocalBeforeChunking, bool moveLastOfEachRowToNextRow, int columns) {
|
||||
// _buildLayoutInGrid(
|
||||
// context,
|
||||
// size,
|
||||
// children,
|
||||
// removeLocalBeforeChunking: removeLocalBeforeChunking,
|
||||
// moveLastOfEachRowToNextRow: moveLastOfEachRowToNextRow,
|
||||
// columns: columns,
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// // if (length <= 3) {
|
||||
// // buildInCols(true, false, 1);
|
||||
// // } else if (length == 5) {
|
||||
// // buildInCols(false, true, 2);
|
||||
// // } else if (length <= 6 || length == 8) {
|
||||
// // buildInCols(false, false, 2);
|
||||
// // } else if (length == 7 || length == 9) {
|
||||
// // buildInCols(true, false, 2);
|
||||
// // } else if (length == 10) {
|
||||
// // buildInCols(false, true, 3);
|
||||
// // } else if (length == 13 || length == 16) {
|
||||
// // buildInCols(true, false, 3);
|
||||
// // } else if (length <= 18) {
|
||||
// // buildInCols(false, false, 3);
|
||||
// // }
|
||||
//
|
||||
// return Column(
|
||||
// children: children,
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// void _buildOverlayLayout(BuildContext context, Size size, List<Widget> children) {
|
||||
// final participants = _conferenceRoom.participants;
|
||||
// if (participants.length == 1) {
|
||||
// children.add(_buildNoiseBox());
|
||||
// } else {
|
||||
// final remoteParticipant = participants.firstWhere((ParticipantWidget participant) => participant.isRemote, orElse: () => null);
|
||||
// if (remoteParticipant != null) {
|
||||
// children.add(remoteParticipant);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// final localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null);
|
||||
// if (localParticipant != null) {
|
||||
// children.add(DraggablePublisher(
|
||||
// key: Key('publisher'),
|
||||
// child: localParticipant,
|
||||
// availableScreenSize: size,
|
||||
// onButtonBarVisible: _onButtonBarVisibleStreamController.stream,
|
||||
// onButtonBarHeight: _onButtonBarHeightStreamController.stream,
|
||||
// ));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// void _buildLayoutInGrid(
|
||||
// BuildContext context,
|
||||
// Size size,
|
||||
// List<Widget> children, {
|
||||
// bool removeLocalBeforeChunking = false,
|
||||
// bool moveLastOfEachRowToNextRow = false,
|
||||
// int columns = 2,
|
||||
// }) {
|
||||
// final participants = _conferenceRoom.participants;
|
||||
// ParticipantWidget localParticipant;
|
||||
// if (removeLocalBeforeChunking) {
|
||||
// localParticipant = participants.firstWhere((ParticipantWidget participant) => !participant.isRemote, orElse: () => null);
|
||||
// if (localParticipant != null) {
|
||||
// participants.remove(localParticipant);
|
||||
// }
|
||||
// }
|
||||
// final chunkedParticipants = chunk(array: participants, size: columns);
|
||||
// if (localParticipant != null) {
|
||||
// chunkedParticipants.last.add(localParticipant);
|
||||
// participants.add(localParticipant);
|
||||
// }
|
||||
//
|
||||
// if (moveLastOfEachRowToNextRow) {
|
||||
// for (var i = 0; i < chunkedParticipants.length - 1; i++) {
|
||||
// var participant = chunkedParticipants[i].removeLast();
|
||||
// chunkedParticipants[i + 1].insert(0, participant);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (final participantChunk in chunkedParticipants) {
|
||||
// final rowChildren = <Widget>[];
|
||||
// for (final participant in participantChunk) {
|
||||
// rowChildren.add(
|
||||
// Container(
|
||||
// width: size.width / participantChunk.length,
|
||||
// height: size.height / chunkedParticipants.length,
|
||||
// child: participant,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// children.add(
|
||||
// Container(
|
||||
// height: size.height / chunkedParticipants.length,
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
// children: rowChildren,
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// NoiseBox _buildNoiseBox() {
|
||||
// return NoiseBox(
|
||||
// density: NoiseBoxDensity.xLow,
|
||||
// backgroundColor: Colors.grey.shade900,
|
||||
// child: Center(
|
||||
// child: Container(
|
||||
// color: Colors.black54,
|
||||
// width: double.infinity,
|
||||
// height: 40,
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// 'Waiting for another participant to connect to the call...',
|
||||
// key: Key('text-wait'),
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(color: Colors.white),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// List<List<T>> chunk<T>({@required List<T> array, @required int size}) {
|
||||
// final result = <List<T>>[];
|
||||
// if (array.isEmpty || size <= 0) {
|
||||
// return result;
|
||||
// }
|
||||
// var first = 0;
|
||||
// var last = size;
|
||||
// final totalLoop = array.length % size == 0 ? array.length ~/ size : array.length ~/ size + 1;
|
||||
// for (var i = 0; i < totalLoop; i++) {
|
||||
// if (last > array.length) {
|
||||
// result.add(array.sublist(first, array.length));
|
||||
// } else {
|
||||
// result.add(array.sublist(first, last));
|
||||
// }
|
||||
// first = last;
|
||||
// last = last + size;
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// void _onHeightBar(double height) {
|
||||
// _onButtonBarHeightStreamController.add(height);
|
||||
// }
|
||||
//
|
||||
// void _onShowBar() {
|
||||
// setState(() {
|
||||
// SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
|
||||
// });
|
||||
// _onButtonBarVisibleStreamController.add(true);
|
||||
// }
|
||||
//
|
||||
// void _onHideBar() {
|
||||
// setState(() {
|
||||
// SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
|
||||
// });
|
||||
// _onButtonBarVisibleStreamController.add(false);
|
||||
// }
|
||||
//
|
||||
// Future<void> _wakeLock(bool enable) async {
|
||||
// try {
|
||||
// return await (enable ? Wakelock.enable() : Wakelock.disable());
|
||||
// } catch (err) {
|
||||
// print('Unable to change the Wakelock and set it to $enable');
|
||||
// print(err);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// void _conferenceRoomUpdated() {
|
||||
// setState(() {});
|
||||
// }
|
||||
// }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue