Skip to content

Commit

Permalink
Dependency Upgrade season (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa authored Dec 27, 2024
2 parents e82fe7e + cc22736 commit 54895fc
Show file tree
Hide file tree
Showing 30 changed files with 142 additions and 382 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
distribution: "zulu"
java-version: "17"
cache: "gradle"
check-latest: true
- uses: subosito/flutter-action@v2.8.0
with:
Expand Down Expand Up @@ -136,13 +136,17 @@ jobs:
architecture: x64
# cache: true

- name: Update Pods
working-directory: ./macos/
run: |
pod repo update
pod cache clean mdk
rm -rf /Pods
rm -rf /Podfile.lock
- run: flutter gen-l10n
- run: flutter pub get

- name: Update Pods
working-directory: ./ios/
run: pod repo update

- run: flutter build macos --verbose
- run: 7z a bluecherry-macos.7z build/macos/Build/Products/Release/unity.app
- name: Release
Expand Down Expand Up @@ -377,6 +381,7 @@ jobs:
uses: subosito/flutter-action@v2.8.0
with:
channel: "stable"
flutter-version: 3.24.0
cache: false

- name: Initiate Flutter
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.pub-cache/
.pub/
/build/
.fvm/
.fvm*

# Web related

Expand Down
34 changes: 1 addition & 33 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
prefer_single_quotes: true
sort_child_properties_last: true
directives_ordering: true
avoid_relative_lib_imports: true
sized_box_for_whitespace: true
use_colored_box: true
use_decorated_box: true
avoid_unnecessary_containers: true
omit_local_variable_types: true
prefer_contains: true
unnecessary_await_in_return: true
unnecessary_parenthesis: true
unnecessary_to_list_in_spreads: true
use_build_context_synchronously: true
use_to_and_as_if_applicable: true
unnecessary_lambdas: true
exhaustive_cases: true
flutter_style_todos: true
cascade_invocations: true
avoid_redundant_argument_values: true
always_use_package_imports: true
use_rethrow_when_possible: true
sort_unnamed_constructors_first: true
tighten_type_of_initializing_formals: true
prefer_iterable_whereType: true
avoid_void_async: true
await_only_futures: true
avoid_escaping_inner_quotes: true
depend_on_referenced_packages: false

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
rules:
21 changes: 1 addition & 20 deletions lib/providers/settings_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import 'dart:io';

import 'package:bluecherry_client/models/server.dart';
import 'package:bluecherry_client/providers/app_provider_interface.dart';
import 'package:bluecherry_client/providers/downloads_provider.dart';
import 'package:bluecherry_client/providers/update_provider.dart';
import 'package:bluecherry_client/screens/events_timeline/desktop/timeline.dart';
import 'package:bluecherry_client/screens/settings/shared/options_chooser_tile.dart';
import 'package:bluecherry_client/utils/logging.dart';
Expand All @@ -39,7 +36,6 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:intl/intl.dart';
import 'package:launch_at_startup/launch_at_startup.dart';
import 'package:unity_video_player/unity_video_player.dart';
import 'package:unity_video_player_main/unity_video_player_main.dart';
import 'package:window_manager/window_manager.dart';

enum NetworkUsage {
Expand Down Expand Up @@ -599,22 +595,7 @@ class SettingsProvider extends UnityProvider {
saveAs: (value) => value.index.toString(),
);
static bool get isHardwareZoomSupported {
if (kIsWeb || Platform.isMacOS || UpdateManager.isEmbedded) {
return false;
}

// In case the UnityVideoPlayerInterface is not available, such as in secondary
// entrypoints, we assume that the hardware zoom is not supported.
try {
if (UnityVideoPlayerInterface.instance.runtimeType !=
UnityVideoPlayerMediaKitInterface) {
return false;
}
} catch (_) {
return false;
}

return true;
return UnityVideoPlayerInterface.instance.supportsHardwareZoom;
}

final kSoftwareZooming = _SettingsOption<bool>(
Expand Down
4 changes: 0 additions & 4 deletions lib/providers/update_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@ class UpdateManager extends UnityProvider {
case LinuxPlatform.embedded:
case LinuxPlatform.appImage:
throw UnsupportedError('AppImages do not support updating from app');
default:
throw UnsupportedError(
'Can not install an executable on an unknown environment',
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/screens/events_browser/date_time_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ class _FilterCard extends StatelessWidget {
title,
style: theme.textTheme.titleSmall?.copyWith(
color: onPressed == null
? theme.colorScheme.onSurface.withOpacity(0.5)
? theme.colorScheme.onSurface.withValues(alpha: 0.5)
: null,
),
),
Text(
value,
style: TextStyle(
color: onPressed == null
? theme.colorScheme.onSurface.withOpacity(0.5)
? theme.colorScheme.onSurface.withValues(alpha: 0.5)
: theme.colorScheme.onSurface,
),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/screens/events_timeline/desktop/timeline_tiles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ class _TimelineTile extends StatefulWidget {
return Builder(builder: (context) {
final theme = Theme.of(context);
final border = Border(
right: BorderSide(color: theme.disabledColor.withOpacity(0.5)),
top: BorderSide(color: theme.dividerColor.withOpacity(0.5)),
right: BorderSide(color: theme.disabledColor.withValues(alpha: 0.5)),
top: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)),
);

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

final border = Border(
right: BorderSide(color: theme.disabledColor.withOpacity(0.5)),
top: BorderSide(color: theme.dividerColor.withOpacity(0.5)),
right: BorderSide(color: theme.disabledColor.withValues(alpha: 0.5)),
top: BorderSide(color: theme.dividerColor.withValues(alpha: 0.5)),
);

return Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class NavigationRailDrawerData {
const NavigationRailDrawerData({required this.theme});

Color get selectedBackgroundColor =>
theme.colorScheme.primary.withOpacity(0.2);
theme.colorScheme.primary.withValues(alpha: 0.2);
Color get selectedForegroundColor => theme.colorScheme.primary;
Color? get unselectedForegroundColor => theme.iconTheme.color;
}
2 changes: 1 addition & 1 deletion lib/screens/layouts/desktop/stream_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class _StreamDataState extends State<StreamData> {
padding: const EdgeInsetsDirectional.only(end: 8.0),
child: PTZToggleButton(
enabledColor: theme.colorScheme.primary,
disabledColor: theme.colorScheme.primary.withOpacity(0.5),
disabledColor: theme.colorScheme.primary.withValues(alpha: 0.5),
ptzEnabled: ptzEnabled,
onChanged: (v) {
setState(() => ptzEnabled = v);
Expand Down
6 changes: 1 addition & 5 deletions lib/screens/layouts/video_status_label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ import 'package:bluecherry_client/models/event.dart';
import 'package:bluecherry_client/providers/settings_provider.dart';
import 'package:bluecherry_client/utils/date.dart';
import 'package:bluecherry_client/utils/extensions.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:intl/intl.dart' show DateFormat;
import 'package:provider/provider.dart';
import 'package:unity_video_player/unity_video_player.dart';
import 'package:unity_video_player_main/unity_video_player_main.dart';

/// The position of the [VideoStatusLabel].
enum VideoStatusLabelPosition {
Expand Down Expand Up @@ -291,9 +289,7 @@ class _DeviceVideoInfo extends StatelessWidget {
'x'
'${video.player.height ?? device.resolutionY}',
),
if (!kIsWeb &&
UnityVideoPlayerInterface.instance
is UnityVideoPlayerMediaKitInterface)
if (UnityVideoPlayerInterface.instance.supportsFPS)
_buildTextSpan(context, title: loc.fps, data: '${video.fps}'),
_buildTextSpan(
context,
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/players/event_player_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class _VideoViewportState extends State<VideoViewport> {
overlayShape:
const RoundSliderOverlayShape(overlayRadius: 12.0),
overlayColor:
theme.colorScheme.primary.withOpacity(0.4),
theme.colorScheme.primary.withValues(alpha: 0.4),
thumbColor: theme.colorScheme.primary,
trackHeight: 2.0,
thumbShape: const RoundSliderThumbShape(
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/servers/finish.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class LetsGoScreen extends StatelessWidget {
elevation: 4.0,
margin: const EdgeInsetsDirectional.only(bottom: 8.0),
color: Color.alphaBlend(
Colors.green.withOpacity(0.2),
Colors.green.withValues(alpha: 0.2),
theme.cardColor,
),
child: Padding(
Expand Down
4 changes: 3 additions & 1 deletion lib/screens/settings/application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,9 @@ class _KeybindingDialogState extends State<KeybindingDialog> {
final key = LogicalKeyboardKey.findKeyByKeyId(event.logicalKey.keyId)!;
if (key == LogicalKeyboardKey.control ||
key == LogicalKeyboardKey.alt ||
key == LogicalKeyboardKey.shift) return;
key == LogicalKeyboardKey.shift) {
return;
}

_newActivator = SingleActivator(
key,
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/settings/settings_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class _MobileSettingsState extends State<MobileSettings> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
tileColor: theme.colorScheme.primaryContainer.withOpacity(0.42),
tileColor:
theme.colorScheme.primaryContainer.withValues(alpha: 0.42),
),
child: ListView(
padding: const EdgeInsetsDirectional.all(8.0),
Expand Down
10 changes: 8 additions & 2 deletions lib/utils/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ class VideoOverlay {
return {
'text': text,
'textStyle': {
'color': textStyle?.color?.value.toRadixString(16),
'color': textStyle?.color == null
? null
: '#'
'${(textStyle!.color!.a * 255).toInt().toRadixString(16).padLeft(2, '0')}'
'${(textStyle!.color!.r * 255).toInt().toRadixString(16).padLeft(2, '0')}'
'${(textStyle!.color!.g * 255).toInt().toRadixString(16).padLeft(2, '0')}'
'${(textStyle!.color!.b * 255).toInt().toRadixString(16).padLeft(2, '0')}',
'fontSize': textStyle?.fontSize,
},
'position_x': position.dx,
Expand Down Expand Up @@ -255,7 +261,7 @@ Future<void> handleConfigurationFile(File file) async {
int.parse(
'0xFF${(overlayData['color'] as String).replaceAll('#', '')}',
),
).withOpacity(opacity),
).withValues(alpha: opacity),
fontSize: (overlayData['size'] as num?)?.toDouble(),
);
final position = Offset(
Expand Down
Loading

0 comments on commit 54895fc

Please sign in to comment.