Skip to content

Commit

Permalink
MacOS support (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Dec 8, 2023
2 parents 23a9e69 + ca9ff2e commit d94e507
Show file tree
Hide file tree
Showing 61 changed files with 2,168 additions and 307 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ jobs:

- run: flutter gen-l10n
- run: flutter pub get
- run: flutter build ios --verbose --release --no-codesign
- run: flutter build ipa --verbose --release --no-codesign
- run: flutter build ios --verbose --no-codesign
- run: flutter build ipa --verbose --no-codesign

# App should be published with TestFlight
# - name: Release
Expand All @@ -112,6 +112,34 @@ jobs:
# .exe
# token: ${{ secrets.GITHUB_TOKEN }}

build_macOS:
name: Bluecherry Client macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- uses: subosito/flutter-action@v2.8.0
with:
channel: "master"
architecture: x64
# cache: true

- run: flutter gen-l10n
- run: flutter pub get
- run: flutter build macos --verbose
- run: 7z a bluecherry-macos.7z build/macos/Build/Products/Release/unity.app
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
bluecherry-macos.7z
token: ${{ secrets.GITHUB_TOKEN }}

build_windows:
name: Bluecherry Client Windows
runs-on: windows-latest
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/flutter_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
jobs:
package-analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,4 +29,21 @@ jobs:
run: dart format --set-exit-if-changed .

- name: Run analysis
run: flutter analyze
run: flutter analyze

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Install Flutter
uses: subosito/flutter-action@v2.8.0
with:
channel: master

- run: flutter upgrade
- run: flutter pub get
- run: flutter gen-l10n
- run: flutter test
29 changes: 7 additions & 22 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: ce8efb439e7405a9c5e99d81252ba721229b8465
channel: master
revision: "9e1c857886f07d342cf106f2cd588bcd5e031bb2"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
base_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
- platform: android
create_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
base_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
- platform: ios
create_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
base_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
- platform: linux
create_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
base_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
- platform: macos
create_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
base_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
- platform: web
create_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
base_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
- platform: windows
create_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
base_revision: ce8efb439e7405a9c5e99d81252ba721229b8465
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2

# User provided section

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This project & work under this repository is licensed under [GNU General Public
| Android | iOS | Windows | GNU/Linux | MacOS |
| ------- | --- | ------- | ----- | ----- |
| [arm64 `.apk`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-android-arm64-v8a-release.apk) | [App Store](https://apps.apple.com/us/app/bluecherry-mobile/id1555805139) | [Windows Setup](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-windows-setup.exe) | [AppImage](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/Bluecherry-latest.AppImage) | 馃毀 **SOON** ~~[App Store](https://github.com/bluecherrydvr/unity/issues/112)~~ |
| [armabi `.apk`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-android-armeabi-v7a-release.apk) | | 馃毀 **SOON** ~~`winget install bluecherry`~~ | [Ubuntu/Debian `.deb`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-linux-x86_64.deb) | |
| [armabi `.apk`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-android-armeabi-v7a-release.apk) | | 馃毀 **SOON** ~~`winget install bluecherry`~~ | [Ubuntu/Debian `.deb`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-linux-x86_64.deb) | [Executable `.app`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-macos.7z) |
| [x86_64 `.apk`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-android-x86_64-release.apk) | | 馃毀 **SOON** ~~Microsoft Store~~ | [Raw Executable `.tar.gz`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-linux-x86_64.tar.gz) | |
| 馃毀 **SOON** ~~Play Store~~ | | | [Fedora/Red Hat Linux `.rpm`](https://github.com/bluecherrydvr/unity/releases/download/bleeding_edge/bluecherry-linux-x86_64.rpm) | |

Expand Down Expand Up @@ -152,7 +152,7 @@ git clone https://github.com/bluecherrydvr/unity
cd unity
flutter pub get
flutter gen-l10n
flutter build [linux|windows|android|ios]
flutter build [linux|windows|macos|android|ios]
```

The automated build process is done using GitHub Actions. You may find the workflow [here](.github/workflows/main.yml). The workflow builds the app for all supported platforms & uploads the artifacts to the release page.
Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"directCamera": "Direct Camera",
"addServer": "Add Server",
"settings": "Settings",
"noServersAdded": "No servers added",
"noServersAdded": "You haven't added any servers yet :/",
"howToAddServer": "Go to the \"Add Server\" screen to add a server.",
"editServerInfo": "Edit server info",
"editServer": "Edit server {serverName}",
"@editServer": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"addServer": "Ajouter serveur",
"settings": "Param猫tres",
"noServersAdded": "Aucun serveur ajout茅",
"howToAddServer": "Go to the \"Add Server\" screen to add a server.",
"editServerInfo": "Modifier les info serveur",
"editServer": "Modifier le serveur {serverName}",
"@editServer": {
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"addServer": "Dodaj serwer",
"settings": "Ustawienia",
"noServersAdded": "Nie dodano serwer贸w",
"howToAddServer": "Go to the \"Add Server\" screen to add a server.",
"editServerInfo": "Modyfikuj聽informacj臋 serwera",
"editServer": "Modyfikuj serwer {serverName}",
"@editServer": {
Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"directCamera": "C芒mera espec铆fica",
"addServer": "Adicionar servidor",
"settings": "Configura莽玫es",
"noServersAdded": "Nenhum servidor adicionado",
"noServersAdded": "Voc锚 ainda n茫o adicionou nenhum servidor :/",
"howToAddServer": "V谩 脿 \"Adicionar Servidor\" para adicionar um servidor.",
"editServerInfo": "Editar informa莽玫es do servidor",
"editServer": "Editar servidor {serverName}",
"@editServer": {
Expand Down
1 change: 1 addition & 0 deletions lib/providers/downloads_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class DownloadsManager extends ChangeNotifier {
headers: {HttpHeaders.acceptEncodingHeader: '*'}, // disable gzip
),
onReceiveProgress: (received, total) {
// TODO(bdlukaa): update window progress bar
if (total != -1) {
downloading[event] = received / total;
notifyListeners();
Expand Down
114 changes: 67 additions & 47 deletions lib/utils/widgets/tree_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,75 @@ Widget buildCheckbox({
double checkboxScale = 0.8,
FlexFit textFit = FlexFit.loose,
}) {
final checkbox = Transform.scale(
scale: checkboxScale,
child: Checkbox(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity: const VisualDensity(horizontal: -4, vertical: -4),
splashRadius: 0.0,
tristate: true,
value: value,
isError: isError,
onChanged: onChanged,
),
);

return Builder(builder: (context) {
final theme = Theme.of(context);
return Row(children: [
checkbox,
Expanded(
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
onChanged(value == null ? true : !value);
},
child: Row(children: [
SizedBox(width: gapCheckboxText),
Flexible(
fit: textFit,
child: Text(
text,
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: false,
style: TextStyle(
decoration: isError ? TextDecoration.lineThrough : null,
),
),
final loc = AppLocalizations.of(context);
final checkbox = SizedBox.fromSize(
size: const Size(24.0, 24.0),
child: isError
? Tooltip(
message: loc.offline,
child: Icon(
Icons.videocam_off_outlined,
size: 16.0,
color: theme.colorScheme.error,
),
)
: Transform.scale(
scale: checkboxScale,
child: Checkbox.adaptive(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
visualDensity:
const VisualDensity(horizontal: -4, vertical: -4),
splashRadius: 0.0,
tristate: true,
value: value,
isError: isError,
onChanged: onChanged,
side:
isError ? BorderSide(color: theme.colorScheme.error) : null,
),
if (secondaryText != null)
Text(
secondaryText,
style: theme.textTheme.labelSmall,
),
);

return SizedBox(
height: isError ? 18.0 : 24.0,
child: Row(children: [
checkbox,
Expanded(
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
onChanged(value == null ? true : !value);
},
child: Row(children: [
SizedBox(width: gapCheckboxText),
Flexible(
fit: textFit,
child: Text(
text,
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: false,
style: TextStyle(
color: isError ? theme.colorScheme.error : null,
// decoration: isError ? TextDecoration.lineThrough : null,
),
),
),
const SizedBox(width: 10.0),
]),
if (secondaryText != null)
Text(
secondaryText,
style: theme.textTheme.labelSmall,
),
const SizedBox(width: 10.0),
]),
),
),
),
)
]);
)
]),
);
});
}

Expand Down Expand Up @@ -228,12 +248,12 @@ class _NodeWidgetState extends State<NodeWidget> {
Row(children: [
if (!_isLeaf && _isEnabled)
Padding(
padding: const EdgeInsetsDirectional.only(start: 8.0),
padding: const EdgeInsetsDirectional.only(start: 8.0, end: 4.0),
child: Tooltip(
message: _isExpanded ? loc.collapse : loc.expand,
child: InkWell(
onTap: onIconPressed,
borderRadius: BorderRadius.circular(100),
borderRadius: BorderRadius.circular(6.0),
child: Padding(
padding: const EdgeInsetsDirectional.all(4.5),
child: Icon(icon, size: widget.iconSize),
Expand All @@ -243,7 +263,7 @@ class _NodeWidgetState extends State<NodeWidget> {
)
// If it is not leaf nor enabled, mimic the space of the icon button
else if (!_isLeaf && !_isEnabled)
const SizedBox(width: 35.0),
const SizedBox(width: 39.0),
Expanded(child: widget.treeNode.content),
]),
if (_isExpanded && !_isLeaf)
Expand Down
26 changes: 11 additions & 15 deletions lib/utils/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,17 @@ const kInitialWindowSize = Size(1066, 645);
/// Configures the current window
Future<void> configureWindow() async {
await WindowManager.instance.ensureInitialized();
windowManager.waitUntilReadyToShow().then((_) async {
await windowManager.setTitleBarStyle(
TitleBarStyle.hidden,
windowButtonVisibility: false,
);
// await windowManager.setMinimumSize(kInitialWindowSize);
if (kDebugMode) {
await windowManager.setMinimumSize(const Size(100, 100));
} else {
await windowManager.setSize(kInitialWindowSize);
}
// await windowManager.center();
await windowManager.setSkipTaskbar(false);
await windowManager.show();
});
windowManager.waitUntilReadyToShow(
const WindowOptions(
minimumSize: kDebugMode ? Size(100, 100) : kInitialWindowSize,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.hidden,
windowButtonVisibility: true,
),
() async {
await windowManager.show();
},
);
}

/// Configures the camera sub window
Expand Down

0 comments on commit d94e507

Please sign in to comment.