Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Extract Build Info
shell: bash
run: |
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
Expand Down Expand Up @@ -96,6 +97,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Extract Build Info
shell: bash
run: |
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
Expand Down Expand Up @@ -196,6 +198,7 @@ jobs:
submodules: recursive

- name: Extract Build Info
shell: bash
run: |
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
Expand Down Expand Up @@ -267,6 +270,7 @@ jobs:
submodules: recursive

- name: Extract Build Info
shell: bash
run: |
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
Expand Down Expand Up @@ -410,12 +414,13 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive

- name: Extract Build Info
run: |
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
echo "BUILD_NAME=3.0.0-bleeding_edge+${{ github.run_number }}" >> $GITHUB_ENV
fi
# - name: Extract Build Info
# shell: bash
# run: |
# echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
# if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
# echo "BUILD_NAME=3.0.0-bleeding_edge+${{ github.run_number }}" >> $GITHUB_ENV
# fi

- name: Install Flutter
uses: subosito/flutter-action@v2.8.0
Expand All @@ -432,7 +437,7 @@ jobs:

- name: Build
run: |
flutterpi_tool build --release --cpu=pi4 --build-number=${{ env.BUILD_NUMBER }} ${{ env.BUILD_NAME && format('--build-name={0}', env.BUILD_NAME) }}
flutterpi_tool build --release --cpu=pi4

build_web:
name: Bluecherry Web
Expand All @@ -445,6 +450,7 @@ jobs:
submodules: recursive

- name: Extract Build Info
shell: bash
run: |
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
Expand Down
16 changes: 16 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import 'package:bluecherry_client/firebase_messaging_background_handler.dart';
import 'package:bluecherry_client/l10n/generated/app_localizations.dart';
import 'package:bluecherry_client/models/device.dart';
import 'package:bluecherry_client/models/event.dart';
import 'package:bluecherry_client/models/layout.dart';
import 'package:bluecherry_client/models/server.dart';
import 'package:bluecherry_client/providers/downloads_provider.dart';
import 'package:bluecherry_client/providers/events_provider.dart';
Expand Down Expand Up @@ -396,6 +397,21 @@ class _UnityAppState extends State<UnityApp>
);
}

if (settings.name == '/fullscreen-layout') {
final data = settings.arguments! as Map;
final Layout layout = data['layout'];

return MaterialPageRoute(
settings: RouteSettings(
name: settings.name,
arguments: layout,
),
builder: (context) {
return AlternativeLayoutView(layout: layout);
},
);
}

if (settings.name == '/rtsp') {
final url = settings.arguments as String;
return MaterialPageRoute(
Expand Down
45 changes: 33 additions & 12 deletions lib/screens/layouts/desktop/layout_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ class LayoutView extends StatelessWidget {
this.onAccept,
this.onWillAccept,
this.onReorder,
this.showOptions,
});

final Layout layout;

final ValueChanged<Device>? onAccept;
final DragTargetWillAccept<Device>? onWillAccept;
final ReorderCallback? onReorder;
final bool? showOptions;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -378,7 +380,7 @@ class LayoutView extends StatelessWidget {
child: SafeArea(
child: Column(
children: [
if (!settings.isImmersiveMode && !isAlternativeWindow)
if (showOptions ?? !settings.isImmersiveMode)
Padding(
padding: const EdgeInsets.all(16.0),
child: IntrinsicHeight(
Expand Down Expand Up @@ -414,8 +416,13 @@ class LayoutView extends StatelessWidget {

class LayoutOptions extends StatefulWidget {
final Layout layout;
final bool isFullscreen;

const LayoutOptions({super.key, required this.layout});
const LayoutOptions({
super.key,
required this.layout,
this.isFullscreen = false,
});

@override
State<LayoutOptions> createState() => _LayoutOptionsState();
Expand All @@ -432,6 +439,8 @@ class _LayoutOptionsState extends State<LayoutOptions> {
final isAlternativeWindow = AlternativeWindow.maybeOf(context) != null;

return Row(
spacing: 4.0,
mainAxisAlignment: MainAxisAlignment.end,
children: [
if (widget.layout.devices.isNotEmpty)
...() {
Expand Down Expand Up @@ -493,18 +502,30 @@ class _LayoutOptionsState extends State<LayoutOptions> {
tooltip: loc.openInANewWindow,
onPressed: widget.layout.openInANewWindow,
),
if (!isAlternativeWindow && !widget.isFullscreen)
SquaredIconButton(
icon: Icon(Icons.fullscreen_rounded, color: Colors.white),
tooltip: loc.showFullscreenCamera,
onPressed: () async {
Navigator.of(context).pushNamed(
'/fullscreen-layout',
arguments: {'layout': widget.layout},
);
},
),
// TODO(bdlukaa): "Add" button. Displays a popup with the current
// available cameras
SquaredIconButton(
icon: const Icon(Icons.edit, color: Colors.white),
tooltip: loc.editLayout,
onPressed: () {
showDialog(
context: context,
builder: (context) => EditLayoutDialog(layout: widget.layout),
);
},
),
if (!isAlternativeWindow && !widget.isFullscreen)
SquaredIconButton(
icon: const Icon(Icons.edit, color: Colors.white),
tooltip: loc.editLayout,
onPressed: () {
showDialog(
context: context,
builder: (context) => EditLayoutDialog(layout: widget.layout),
);
},
),
SquaredIconButton(
icon: const Icon(Icons.import_export, color: Colors.white),
tooltip: loc.exportLayout,
Expand Down
26 changes: 16 additions & 10 deletions lib/screens/layouts/desktop/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ const kCompactSidebarConstraints = BoxConstraints(maxWidth: 80.0);

class DesktopSidebar extends StatefulWidget {
final Widget collapseButton;
final bool showLayoutManager;

const DesktopSidebar({super.key, required this.collapseButton});
const DesktopSidebar({
super.key,
required this.collapseButton,
this.showLayoutManager = true,
});

@override
State<DesktopSidebar> createState() => _DesktopSidebarState();
Expand Down Expand Up @@ -70,15 +75,16 @@ class _DesktopSidebarState extends State<DesktopSidebar> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LayoutManager(
collapseButton: widget.collapseButton,
onSearchChanged: (text) {
setState(() {
searchQuery = text;
_updateServers();
});
},
),
if (widget.showLayoutManager)
LayoutManager(
collapseButton: widget.collapseButton,
onSearchChanged: (text) {
setState(() {
searchQuery = text;
_updateServers();
});
},
),
if (servers.servers.isEmpty)
const Expanded(child: NoServers())
else
Expand Down
Loading
Loading