Skip to content

Commit 54895fc

Browse files
authored
Dependency Upgrade season (#305)
2 parents e82fe7e + cc22736 commit 54895fc

30 files changed

+142
-382
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
- name: Setup Java
2424
uses: actions/setup-java@v4
2525
with:
26-
distribution: 'zulu'
27-
java-version: '17'
28-
cache: 'gradle'
26+
distribution: "zulu"
27+
java-version: "17"
28+
cache: "gradle"
2929
check-latest: true
3030
- uses: subosito/[email protected]
3131
with:
@@ -136,13 +136,17 @@ jobs:
136136
architecture: x64
137137
# cache: true
138138

139+
- name: Update Pods
140+
working-directory: ./macos/
141+
run: |
142+
pod repo update
143+
pod cache clean mdk
144+
rm -rf /Pods
145+
rm -rf /Podfile.lock
146+
139147
- run: flutter gen-l10n
140148
- run: flutter pub get
141149

142-
- name: Update Pods
143-
working-directory: ./ios/
144-
run: pod repo update
145-
146150
- run: flutter build macos --verbose
147151
- run: 7z a bluecherry-macos.7z build/macos/Build/Products/Release/unity.app
148152
- name: Release
@@ -377,6 +381,7 @@ jobs:
377381
uses: subosito/[email protected]
378382
with:
379383
channel: "stable"
384+
flutter-version: 3.24.0
380385
cache: false
381386

382387
- name: Initiate Flutter

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.pub-cache/
3131
.pub/
3232
/build/
33-
.fvm/
33+
.fvm*
3434

3535
# Web related
3636

analysis_options.yaml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
include: package:flutter_lints/flutter.yaml
22

33
linter:
4-
rules:
5-
prefer_single_quotes: true
6-
sort_child_properties_last: true
7-
directives_ordering: true
8-
avoid_relative_lib_imports: true
9-
sized_box_for_whitespace: true
10-
use_colored_box: true
11-
use_decorated_box: true
12-
avoid_unnecessary_containers: true
13-
omit_local_variable_types: true
14-
prefer_contains: true
15-
unnecessary_await_in_return: true
16-
unnecessary_parenthesis: true
17-
unnecessary_to_list_in_spreads: true
18-
use_build_context_synchronously: true
19-
use_to_and_as_if_applicable: true
20-
unnecessary_lambdas: true
21-
exhaustive_cases: true
22-
flutter_style_todos: true
23-
cascade_invocations: true
24-
avoid_redundant_argument_values: true
25-
always_use_package_imports: true
26-
use_rethrow_when_possible: true
27-
sort_unnamed_constructors_first: true
28-
tighten_type_of_initializing_formals: true
29-
prefer_iterable_whereType: true
30-
avoid_void_async: true
31-
await_only_futures: true
32-
avoid_escaping_inner_quotes: true
33-
depend_on_referenced_packages: false
34-
35-
# Additional information about this file can be found at
36-
# https://dart.dev/guides/language/analysis-options
4+
rules:

lib/providers/settings_provider.dart

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
import 'dart:io';
21-
2220
import 'package:bluecherry_client/models/server.dart';
2321
import 'package:bluecherry_client/providers/app_provider_interface.dart';
2422
import 'package:bluecherry_client/providers/downloads_provider.dart';
25-
import 'package:bluecherry_client/providers/update_provider.dart';
2623
import 'package:bluecherry_client/screens/events_timeline/desktop/timeline.dart';
2724
import 'package:bluecherry_client/screens/settings/shared/options_chooser_tile.dart';
2825
import 'package:bluecherry_client/utils/logging.dart';
@@ -39,7 +36,6 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
3936
import 'package:intl/intl.dart';
4037
import 'package:launch_at_startup/launch_at_startup.dart';
4138
import 'package:unity_video_player/unity_video_player.dart';
42-
import 'package:unity_video_player_main/unity_video_player_main.dart';
4339
import 'package:window_manager/window_manager.dart';
4440

4541
enum NetworkUsage {
@@ -599,22 +595,7 @@ class SettingsProvider extends UnityProvider {
599595
saveAs: (value) => value.index.toString(),
600596
);
601597
static bool get isHardwareZoomSupported {
602-
if (kIsWeb || Platform.isMacOS || UpdateManager.isEmbedded) {
603-
return false;
604-
}
605-
606-
// In case the UnityVideoPlayerInterface is not available, such as in secondary
607-
// entrypoints, we assume that the hardware zoom is not supported.
608-
try {
609-
if (UnityVideoPlayerInterface.instance.runtimeType !=
610-
UnityVideoPlayerMediaKitInterface) {
611-
return false;
612-
}
613-
} catch (_) {
614-
return false;
615-
}
616-
617-
return true;
598+
return UnityVideoPlayerInterface.instance.supportsHardwareZoom;
618599
}
619600

620601
final kSoftwareZooming = _SettingsOption<bool>(

lib/providers/update_provider.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,6 @@ class UpdateManager extends UnityProvider {
402402
case LinuxPlatform.embedded:
403403
case LinuxPlatform.appImage:
404404
throw UnsupportedError('AppImages do not support updating from app');
405-
default:
406-
throw UnsupportedError(
407-
'Can not install an executable on an unknown environment',
408-
);
409405
}
410406
}
411407

lib/screens/events_browser/date_time_filter.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,15 @@ class _FilterCard extends StatelessWidget {
236236
title,
237237
style: theme.textTheme.titleSmall?.copyWith(
238238
color: onPressed == null
239-
? theme.colorScheme.onSurface.withOpacity(0.5)
239+
? theme.colorScheme.onSurface.withValues(alpha: 0.5)
240240
: null,
241241
),
242242
),
243243
Text(
244244
value,
245245
style: TextStyle(
246246
color: onPressed == null
247-
? theme.colorScheme.onSurface.withOpacity(0.5)
247+
? theme.colorScheme.onSurface.withValues(alpha: 0.5)
248248
: theme.colorScheme.onSurface,
249249
),
250250
),

lib/screens/events_timeline/desktop/timeline_tiles.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ class _TimelineTile extends StatefulWidget {
287287
return Builder(builder: (context) {
288288
final theme = Theme.of(context);
289289
final border = Border(
290-
right: BorderSide(color: theme.disabledColor.withOpacity(0.5)),
291-
top: BorderSide(color: theme.dividerColor.withOpacity(0.5)),
290+
right: BorderSide(color: theme.disabledColor.withValues(alpha: 0.5)),
291+
top: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)),
292292
);
293293

294294
return
@@ -358,8 +358,8 @@ class _TimelineTileState extends State<_TimelineTile> {
358358
final settings = context.watch<SettingsProvider>();
359359

360360
final border = Border(
361-
right: BorderSide(color: theme.disabledColor.withOpacity(0.5)),
362-
top: BorderSide(color: theme.dividerColor.withOpacity(0.5)),
361+
right: BorderSide(color: theme.disabledColor.withValues(alpha: 0.5)),
362+
top: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)),
363363
);
364364

365365
return Row(crossAxisAlignment: CrossAxisAlignment.start, children: [

lib/screens/home.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class NavigationRailDrawerData {
305305
const NavigationRailDrawerData({required this.theme});
306306

307307
Color get selectedBackgroundColor =>
308-
theme.colorScheme.primary.withOpacity(0.2);
308+
theme.colorScheme.primary.withValues(alpha: 0.2);
309309
Color get selectedForegroundColor => theme.colorScheme.primary;
310310
Color? get unselectedForegroundColor => theme.iconTheme.color;
311311
}

lib/screens/layouts/desktop/stream_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class _StreamDataState extends State<StreamData> {
378378
padding: const EdgeInsetsDirectional.only(end: 8.0),
379379
child: PTZToggleButton(
380380
enabledColor: theme.colorScheme.primary,
381-
disabledColor: theme.colorScheme.primary.withOpacity(0.5),
381+
disabledColor: theme.colorScheme.primary.withValues(alpha: 0.5),
382382
ptzEnabled: ptzEnabled,
383383
onChanged: (v) {
384384
setState(() => ptzEnabled = v);

lib/screens/layouts/video_status_label.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ import 'package:bluecherry_client/models/event.dart';
2222
import 'package:bluecherry_client/providers/settings_provider.dart';
2323
import 'package:bluecherry_client/utils/date.dart';
2424
import 'package:bluecherry_client/utils/extensions.dart';
25-
import 'package:flutter/foundation.dart';
2625
import 'package:flutter/material.dart';
2726
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
2827
import 'package:intl/intl.dart' show DateFormat;
2928
import 'package:provider/provider.dart';
3029
import 'package:unity_video_player/unity_video_player.dart';
31-
import 'package:unity_video_player_main/unity_video_player_main.dart';
3230

3331
/// The position of the [VideoStatusLabel].
3432
enum VideoStatusLabelPosition {
@@ -291,9 +289,7 @@ class _DeviceVideoInfo extends StatelessWidget {
291289
'x'
292290
'${video.player.height ?? device.resolutionY}',
293291
),
294-
if (!kIsWeb &&
295-
UnityVideoPlayerInterface.instance
296-
is UnityVideoPlayerMediaKitInterface)
292+
if (UnityVideoPlayerInterface.instance.supportsFPS)
297293
_buildTextSpan(context, title: loc.fps, data: '${video.fps}'),
298294
_buildTextSpan(
299295
context,

lib/screens/players/event_player_mobile.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class _VideoViewportState extends State<VideoViewport> {
336336
overlayShape:
337337
const RoundSliderOverlayShape(overlayRadius: 12.0),
338338
overlayColor:
339-
theme.colorScheme.primary.withOpacity(0.4),
339+
theme.colorScheme.primary.withValues(alpha: 0.4),
340340
thumbColor: theme.colorScheme.primary,
341341
trackHeight: 2.0,
342342
thumbShape: const RoundSliderThumbShape(

lib/screens/servers/finish.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class LetsGoScreen extends StatelessWidget {
4545
elevation: 4.0,
4646
margin: const EdgeInsetsDirectional.only(bottom: 8.0),
4747
color: Color.alphaBlend(
48-
Colors.green.withOpacity(0.2),
48+
Colors.green.withValues(alpha: 0.2),
4949
theme.cardColor,
5050
),
5151
child: Padding(

lib/screens/settings/application.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ class _KeybindingDialogState extends State<KeybindingDialog> {
513513
final key = LogicalKeyboardKey.findKeyByKeyId(event.logicalKey.keyId)!;
514514
if (key == LogicalKeyboardKey.control ||
515515
key == LogicalKeyboardKey.alt ||
516-
key == LogicalKeyboardKey.shift) return;
516+
key == LogicalKeyboardKey.shift) {
517+
return;
518+
}
517519

518520
_newActivator = SingleActivator(
519521
key,

lib/screens/settings/settings_mobile.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class _MobileSettingsState extends State<MobileSettings> {
7676
shape: RoundedRectangleBorder(
7777
borderRadius: BorderRadius.circular(8.0),
7878
),
79-
tileColor: theme.colorScheme.primaryContainer.withOpacity(0.42),
79+
tileColor:
80+
theme.colorScheme.primaryContainer.withValues(alpha: 0.42),
8081
),
8182
child: ListView(
8283
padding: const EdgeInsetsDirectional.all(8.0),

lib/utils/config.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class VideoOverlay {
5050
return {
5151
'text': text,
5252
'textStyle': {
53-
'color': textStyle?.color?.value.toRadixString(16),
53+
'color': textStyle?.color == null
54+
? null
55+
: '#'
56+
'${(textStyle!.color!.a * 255).toInt().toRadixString(16).padLeft(2, '0')}'
57+
'${(textStyle!.color!.r * 255).toInt().toRadixString(16).padLeft(2, '0')}'
58+
'${(textStyle!.color!.g * 255).toInt().toRadixString(16).padLeft(2, '0')}'
59+
'${(textStyle!.color!.b * 255).toInt().toRadixString(16).padLeft(2, '0')}',
5460
'fontSize': textStyle?.fontSize,
5561
},
5662
'position_x': position.dx,
@@ -255,7 +261,7 @@ Future<void> handleConfigurationFile(File file) async {
255261
int.parse(
256262
'0xFF${(overlayData['color'] as String).replaceAll('#', '')}',
257263
),
258-
).withOpacity(opacity),
264+
).withValues(alpha: opacity),
259265
fontSize: (overlayData['size'] as num?)?.toDouble(),
260266
);
261267
final position = Offset(

0 commit comments

Comments
 (0)