Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ tool/*
tool/repro/__pycache__/
.secluso-repro-cache/
.secluso-repro-build.lock
design*
Binary file added assets/walkthrough/wt_1.mp4
Binary file not shown.
Binary file added assets/walkthrough/wt_2.mp4
Binary file not shown.
Binary file added assets/walkthrough/wt_3.mp4
Binary file not shown.
Binary file added assets/walkthrough/wt_4.mp4
Binary file not shown.
Binary file added assets/walkthrough/wt_5.mp4
Binary file not shown.
1 change: 1 addition & 0 deletions lib/keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class PrefKeys {
static const serverUsername = "server_username";
static const serverPassword = "server_password";
static const deviceRole = "device_role";
static const walkthroughSeen = "walkthrough_seen";
static const relayConnectionKind = "relay_connection_kind";
static const recordingMotionVideosPrefix = "recording_motion_videos_";
static const lastRecordingTimestampPrefix = "last_recording_timestamp_";
Expand Down
10 changes: 10 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import 'package:secluso_flutter/ui/secluso_surfaces.dart';
import 'package:secluso_flutter/ui/font_licenses.dart';
import 'package:secluso_flutter/ui/secluso_theme.dart';
import 'package:secluso_flutter/routes/camera-role/camera_role_pages.dart';
import 'package:secluso_flutter/routes/onboarding/walkthrough_page.dart';
import 'package:secluso_flutter/routes/system_shell_page.dart';
import 'dart:isolate';

Expand Down Expand Up @@ -974,6 +975,15 @@ class _StartupRoleGateState extends State<StartupRoleGate> {
}

Future<void> _loadInitialPage() async {
// First launch: walk the user through what Secluso is.
if (!await WalkthroughPage.hasBeenSeen()) {
_show(WalkthroughPage(onDone: _resolveInitialPage));
return;
}
await _resolveInitialPage();
}

Future<void> _resolveInitialPage() async {
final prefs = await SharedPreferences.getInstance();
final hasRelay = (prefs.getString(PrefKeys.serverAddr) ?? '').isNotEmpty;
final role = prefs.getString(PrefKeys.deviceRole);
Expand Down
10 changes: 10 additions & 0 deletions lib/routes/design_lab_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import 'package:secluso_flutter/routes/camera/view_video.dart';
import 'package:secluso_flutter/routes/server_page.dart';
import 'package:secluso_flutter/routes/system_shell_page.dart';
import 'package:secluso_flutter/routes/camera-role/camera_role_pages.dart';
import 'package:secluso_flutter/routes/onboarding/walkthrough_page.dart';
import 'package:secluso_flutter/routes/settings_page.dart' as app_settings;
import 'package:secluso_flutter/ui/secluso_preview_assets.dart';
import 'package:secluso_flutter/routes/theme_provider.dart';
Expand Down Expand Up @@ -485,6 +486,15 @@ Widget? designLabTargetPage(String target, {String themeName = 'dark'}) {
previewServerAddr: reviewSession.relayAddress,
previewCameraNames: reviewSession.cameraNames,
);
case 'walkthrough_1':
case 'walkthrough_2':
case 'walkthrough_3':
case 'walkthrough_4':
case 'walkthrough_5':
return WalkthroughPage(
onDone: () {},
initialIndex: int.parse(target.split('_').last) - 1,
);
case 'role_select':
return Builder(
builder:
Expand Down
Loading