Skip to content

Commit

Permalink
iOS update (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa authored Apr 8, 2024
2 parents 654157d + f24dd1b commit 9dfffcc
Show file tree
Hide file tree
Showing 15 changed files with 137 additions and 122 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
11 changes: 11 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,15 @@ post_install do |installer|
]
end
end
################ Awesome Notifications pod modification ###################
awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks')
require awesome_pod_file
update_awesome_pod_build_settings(installer)
################ Awesome Notifications pod modification ###################
end

################ Awesome Notifications pod modification ###################
awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks')
require awesome_pod_file
update_awesome_main_target_settings('Runner', File.dirname(File.realpath(__FILE__)), flutter_root)
################ Awesome Notifications pod modification ###################
14 changes: 10 additions & 4 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -348,7 +348,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -361,6 +361,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES;
Expand All @@ -369,6 +370,7 @@
DEVELOPMENT_TEAM = 642TR6YWHA;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -428,7 +430,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -477,7 +479,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -492,6 +494,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES;
Expand All @@ -500,6 +503,7 @@
DEVELOPMENT_TEAM = 642TR6YWHA;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -517,6 +521,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES;
Expand All @@ -525,6 +530,7 @@
DEVELOPMENT_TEAM = 642TR6YWHA;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
123 changes: 53 additions & 70 deletions lib/screens/layouts/mobile/device_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import 'package:bluecherry_client/models/device.dart';
import 'package:bluecherry_client/providers/mobile_view_provider.dart';
import 'package:bluecherry_client/providers/settings_provider.dart';
import 'package:bluecherry_client/screens/layouts/video_status_label.dart';
import 'package:bluecherry_client/utils/extensions.dart';
import 'package:bluecherry_client/utils/video_player.dart';
import 'package:bluecherry_client/widgets/device_selector.dart';
import 'package:bluecherry_client/widgets/error_warning.dart';
Expand All @@ -48,11 +47,7 @@ class MobileDeviceView extends StatefulWidget {
final int index;

/// Creates a device view used in mobile grids
const MobileDeviceView({
super.key,
required this.tab,
required this.index,
});
const MobileDeviceView({super.key, required this.tab, required this.index});

@override
State<MobileDeviceView> createState() => _MobileDeviceViewState();
Expand Down Expand Up @@ -190,16 +185,11 @@ class DeviceTile extends StatefulWidget {
final int tab;
final int index;

final double width;
final double height;

const DeviceTile({
super.key,
required this.device,
required this.tab,
required this.index,
this.width = 640.0,
this.height = 360.0,
});

@override
Expand Down Expand Up @@ -232,13 +222,15 @@ class DeviceTileState extends State<DeviceTile> {
},
// Fullscreen on double-tap.
onDoubleTap: () async {
await Navigator.of(context).pushNamed(
'/fullscreen',
arguments: {
'device': widget.device,
'player': videoPlayer,
},
);
if (videoPlayer.error == null) {
await Navigator.of(context).pushNamed(
'/fullscreen',
arguments: {
'device': widget.device,
'player': videoPlayer,
},
);
}
},
child: UnityVideoView(
heroTag: widget.device.streamURL,
Expand All @@ -248,90 +240,82 @@ class DeviceTileState extends State<DeviceTile> {
paneBuilder: (context, controller) {
final video = UnityVideoView.of(context);
final error = video.error;
final isLoading = !controller.isSeekable;

return ClipRect(
child: Stack(children: [
child: Stack(alignment: Alignment.center, children: [
if (error != null)
ErrorWarning(message: error)
else if (!controller.isSeekable)
const Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(Colors.white),
strokeWidth: 1.5,
),
else if (isLoading)
const CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(Colors.white),
strokeWidth: 1.5,
),
if (video.lastImageUpdate != null)
Center(
child: TweenAnimationBuilder(
tween: Tween<double>(
begin: 0.0,
end: hover ? 1.0 : 0.0,
),
duration: const Duration(milliseconds: 300),
builder: (context, value, child) {
return Opacity(
opacity: value,
child: child,
TweenAnimationBuilder(
tween: Tween<double>(
begin: 0.0,
end: hover ? 1.0 : 0.0,
),
duration: const Duration(milliseconds: 300),
builder: (context, value, child) {
return Opacity(
opacity: value,
child: child,
);
},
child: SquaredIconButton(
// splashRadius: 20.0,
onPressed: () async {
await Navigator.of(context).pushNamed(
'/fullscreen',
arguments: {
'device': widget.device,
'player': videoPlayer,
},
);
},
child: SquaredIconButton(
// splashRadius: 20.0,
onPressed: () async {
await Navigator.of(context).pushNamed(
'/fullscreen',
arguments: {
'device': widget.device,
'player': videoPlayer,
},
);
},
icon: const Icon(
Icons.fullscreen,
color: Colors.white,
size: 32.0,
),
icon: const Icon(
Icons.fullscreen,
color: Colors.white,
size: 32.0,
),
),
),
PositionedDirectional(
top: 6.0,
start: 6.0,
child: VideoStatusLabel(
video: video,
device: widget.device,
),
child: VideoStatusLabel(video: video, device: widget.device),
),
PositionedDirectional(
bottom: 0.0,
start: 0.0,
end: 0.0,
child: AnimatedSlide(
offset: Offset(0, hover ? 0.0 : 1.0),
offset: Offset(
0,
error != null || isLoading || hover ? 0.0 : 1.0,
),
duration: const Duration(milliseconds: 200),
curve: Curves.easeInOut,
child: Container(
height: 48.0,
padding: const EdgeInsetsDirectional.only(
start: 16.0,
top: 6.0,
bottom: 6.0,
end: 16.0,
),
alignment: AlignmentDirectional.centerEnd,
color: Colors.black26,
child: Row(children: [
const SizedBox(width: 16.0),
const Icon(
Icons.videocam,
color: Colors.white,
size: 20.0,
),
const SizedBox(width: 16.0),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.device.name
.split(' ')
.map((word) => word.uppercaseFirst)
.join(' '),
widget.device.name,
style: theme.textTheme.displayLarge?.copyWith(
color: Colors.white,
fontSize: 14.0,
Expand All @@ -354,7 +338,6 @@ class DeviceTileState extends State<DeviceTile> {
size: 20.0,
semanticLabel: loc.ptzSupported,
),
const SizedBox(width: 16.0),
]),
),
),
Expand Down
38 changes: 20 additions & 18 deletions lib/screens/layouts/video_status_label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,27 @@ class _VideoStatusLabelState extends State<VideoStatusLabel> {
event: widget.event,
);
final minHeight = label.buildTextSpans(context).length * 15;

final willLeftOverflow =
position.dx + _DeviceVideoInfo.minWidth > constraints.maxWidth;

final left = willLeftOverflow
? (constraints.maxWidth - _DeviceVideoInfo.minWidth - 8.0)
: position.dx;
final top = position.dy > minHeight + 8.0
? null
: position.dy + boxSize.height + 8.0;
final bottom = position.dy > minHeight + 8.0
? constraints.maxHeight - position.dy + 8.0
: null;

return Stack(children: [
if (position.dy > minHeight + 8.0)
Positioned(
bottom: constraints.maxHeight - position.dy + 8.0,
right: constraints.maxWidth - position.dx - boxSize.width,
child: label,
)
else
() {
final willLeftOverflow = position.dx + _DeviceVideoInfo.minWidth >
constraints.maxWidth;
return Positioned(
top: position.dy + boxSize.height + 8.0,
left: willLeftOverflow
? (constraints.maxWidth - _DeviceVideoInfo.minWidth - 8.0)
: position.dx,
child: label,
);
}(),
Positioned(
left: left,
top: top,
bottom: bottom,
child: label,
),
]);
});
});
Expand Down
1 change: 1 addition & 0 deletions lib/widgets/misc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class GestureDetectorWithReducedDoubleTapTime extends StatelessWidget {
Widget build(BuildContext context) {
return GestureDetector(
key: key,
behavior: HitTestBehavior.opaque,
onTap: _onTap,
onTapDown: _onTapDown,
onTapCancel: _onTapCancel,
Expand Down
4 changes: 2 additions & 2 deletions macos/Flutter/ephemeral/Flutter-Generated.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\Users\bruno\Documents\flutter\flutter
FLUTTER_APPLICATION_PATH=C:\Users\bruno\Documents\flutter\paid_projects\unity
FLUTTER_ROOT=/Users/user249455/Documents/development/flutter
FLUTTER_APPLICATION_PATH=/Users/user249455/Documents/GitHub/unity
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=3.0.015
Expand Down
4 changes: 2 additions & 2 deletions macos/Flutter/ephemeral/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\Users\bruno\Documents\flutter\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\bruno\Documents\flutter\paid_projects\unity"
export "FLUTTER_ROOT=/Users/user249455/Documents/development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/user249455/Documents/GitHub/unity"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=3.0.015"
Expand Down
Loading

0 comments on commit 9dfffcc

Please sign in to comment.