Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

feat: introduce new onboarding

Prateek Sunal6c308d6a6c7a
diff --git a/mobile/apps/auth/assets/onboarding_file.png b/mobile/apps/auth/assets/onboarding_file.png
new file mode 100644
index 0000000000..5d83983574
Binary files /dev/null and b/mobile/apps/auth/assets/onboarding_file.png differ
diff --git a/mobile/apps/auth/assets/onboarding_lock.png b/mobile/apps/auth/assets/onboarding_lock.png
new file mode 100644
index 0000000000..be8e90322f
Binary files /dev/null and b/mobile/apps/auth/assets/onboarding_lock.png differ
diff --git a/mobile/apps/auth/assets/onboarding_share.png b/mobile/apps/auth/assets/onboarding_share.png
new file mode 100644
index 0000000000..f21350e493
Binary files /dev/null and b/mobile/apps/auth/assets/onboarding_share.png differ
diff --git a/mobile/apps/auth/assets/svg/auth-logo.svg b/mobile/apps/auth/assets/svg/auth-logo.svg
new file mode 100644
index 0000000000..0a4cd6ff80
--- /dev/null
+++ b/mobile/apps/auth/assets/svg/auth-logo.svg
@@ -0,0 +1,6 @@
+<svg width="53" height="18" viewBox="0 0 53 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M47.7422 4.68917C50.2884 4.68917 52.4566 6.50434 52.4566 9.90777V17.6474H48.675V10.4624C48.675 8.89934 47.6918 8.16824 46.4816 8.16824C45.0951 8.16824 44.1371 8.97497 44.1371 10.7649V17.6474H40.3555V0H44.1371V6.22702C44.8177 5.29423 46.0783 4.68917 47.7422 4.68917Z" fill="white"/>
+<path d="M38.9733 8.67213H36.3766V13.1344C36.3766 14.2185 37.3094 14.3193 38.9733 14.2185V17.6471C34.032 18.1513 32.595 16.6639 32.595 13.1344V8.67213H30.5781V5.0418H32.595V1.71191L36.3766 1.71261V5.0418H38.9733V8.67213Z" fill="white"/>
+<path d="M25.7883 5.04199H29.5698V17.6473H25.7883V16.4624C25.1076 17.3952 23.847 18.0002 22.1831 18.0002C19.6369 18.0002 17.4688 16.1851 17.4688 12.7816V5.04199H21.2503V12.227C21.2503 13.7901 22.2336 14.5212 23.4437 14.5212C24.8302 14.5212 25.7883 13.7144 25.7883 11.9245V5.04199Z" fill="white"/>
+<path d="M12.7314 17.6474L11.849 14.8743H5.29423L4.41186 17.6474H0L6.00012 0H11.1431L17.1432 17.6474H12.7314ZM6.50434 11.0927H10.6389L8.5716 4.61354L6.50434 11.0927Z" fill="white"/>
+</svg>
diff --git a/mobile/apps/auth/lib/l10n/arb/app_en.arb b/mobile/apps/auth/lib/l10n/arb/app_en.arb
index 7dbfc7e61f..05ef4b4b91 100644
--- a/mobile/apps/auth/lib/l10n/arb/app_en.arb
+++ b/mobile/apps/auth/lib/l10n/arb/app_en.arb
@@ -7,6 +7,10 @@
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Securely backup your 2FA codes",
+ "featureBackupCodes": "End to end encrypted\nbackup and sync",
+ "featureSearchEtc": "Search, Tags, Share,\nNext code and a lot more",
+ "featureOpenSource": "Open source and\naudited by security experts",
+ "signUp": "Sign up",
"onBoardingGetStarted": "Get Started",
"setupFirstAccount": "Setup your first account",
"importScanQrCode": "Scan a QR Code",
@@ -588,4 +592,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/mobile/apps/auth/lib/onboarding/view/onboarding_page.dart b/mobile/apps/auth/lib/onboarding/view/onboarding_page.dart
index 5dc8d92763..8918a0413f 100644
--- a/mobile/apps/auth/lib/onboarding/view/onboarding_page.dart
+++ b/mobile/apps/auth/lib/onboarding/view/onboarding_page.dart
@@ -1,19 +1,19 @@
import 'dart:async';
import 'dart:io';
+import 'package:dots_indicator/dots_indicator.dart';
import 'package:ente_accounts/pages/email_entry_page.dart';
import 'package:ente_accounts/pages/login_page.dart';
import 'package:ente_accounts/pages/password_entry_page.dart';
import 'package:ente_accounts/pages/password_reentry_page.dart';
import 'package:ente_auth/app/view/app.dart';
import 'package:ente_auth/core/configuration.dart';
-import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/events/trigger_logout_event.dart';
-import "package:ente_auth/l10n/l10n.dart";
+import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/locale.dart';
-import 'package:ente_auth/theme/text_style.dart';
+import 'package:ente_auth/theme/colors.dart';
+import 'package:ente_auth/theme/ente_theme.dart';
import 'package:ente_auth/ui/account/logout_dialog.dart';
-import 'package:ente_auth/ui/common/gradient_button.dart';
import 'package:ente_auth/ui/components/buttons/button_widget.dart';
import 'package:ente_auth/ui/components/models/button_result.dart';
import 'package:ente_auth/ui/home_page.dart';
@@ -24,8 +24,8 @@ import 'package:ente_auth/utils/dialog_util.dart';
import 'package:ente_auth/utils/navigation_util.dart';
import 'package:ente_auth/utils/toast_util.dart';
import 'package:ente_events/event_bus.dart';
-import 'package:flutter/foundation.dart';
-import "package:flutter/material.dart";
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
import 'package:local_auth/local_auth.dart';
class OnboardingPage extends StatefulWidget {
@@ -41,6 +41,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
late StreamSubscription<TriggerLogoutEvent> _triggerLogoutEvent;
int _developerModeTapCount = 0;
+ double _featureIndex = 0;
@override
void initState() {
@@ -61,154 +62,156 @@ class _OnboardingPageState extends State<OnboardingPage> {
Widget build(BuildContext context) {
debugPrint("Building OnboardingPage");
final l10n = context.l10n;
+ final textTheme = getEnteTextTheme(context);
+
return Scaffold(
- body: SafeArea(
- child: GestureDetector(
- onTap: () async {
- _developerModeTapCount++;
- if (_developerModeTapCount >= kDeveloperModeTapCountThreshold) {
- _developerModeTapCount = 0;
- final result = await showChoiceDialog(
- context,
- title: l10n.developerSettings,
- firstButtonLabel: l10n.yes,
- body: l10n.developerSettingsWarning,
- isDismissible: false,
- );
- if (result?.action == ButtonAction.first) {
- await Navigator.of(context).push(
- MaterialPageRoute(
- builder: (BuildContext context) {
- return const DeveloperSettingsPage();
- },
+ backgroundColor: accentColor,
+ appBar: AppBar(
+ leading: const SizedBox(),
+ title: SvgPicture.asset("assets/svg/auth-logo.svg"),
+ backgroundColor: accentColor,
+ elevation: 0,
+ scrolledUnderElevation: 0,
+ centerTitle: true,
+ actions: 1 != 1
+ ? [
+ GestureDetector(
+ onTap: () async {
+ final locale = (await getLocale())!;
+ // ignore: unawaited_futures
+ routeToPage(
+ context,
+ LanguageSelectorPage(
+ appSupportedLocales,
+ (locale) async {
+ await setLocale(locale);
+ App.setLocale(
+ context,
+ locale,
+ );
+ },
+ locale,
+ ),
+ ).then((value) {
+ setState(() {});
+ });
+ },
+ child: const Padding(
+ padding: EdgeInsets.only(bottom: 12),
+ child: Text(
+ "Lang(i)",
+ style: TextStyle(
+ color: Colors.white,
+ ),
+ ),
),
- );
- setState(() {});
- }
- }
- },
+ ),
+ const SizedBox(width: 16),
+ ]
+ : null,
+ ),
+ body: GestureDetector(
+ onTap: () async => _handleDeveloperTap(context),
+ child: Center(
child: SingleChildScrollView(
child: Center(
child: ConstrainedBox(
- constraints: BoxConstraints(
- minHeight: MediaQuery.of(context).size.height,
- maxWidth: 450,
+ constraints: const BoxConstraints(
+ maxWidth: 420,
),
child: Padding(
padding: const EdgeInsets.symmetric(
- vertical: 40.0,
- horizontal: 40,
+ vertical: 32,
),
child: Column(
children: [
- Column(
- children: [
- kDebugMode
- ? GestureDetector(
- child: const Align(
- alignment: Alignment.topRight,
- child: Text("Lang"),
- ),
- onTap: () async {
- final locale = (await getLocale())!;
- // ignore: unawaited_futures
- routeToPage(
- context,
- LanguageSelectorPage(
- appSupportedLocales,
- (locale) async {
- await setLocale(locale);
- App.setLocale(context, locale);
- },
- locale,
- ),
- ).then((value) {
- setState(() {});
- });
- },
- )
- : const SizedBox(),
- Image.asset(
- "assets/sheild-front-gradient.png",
- width: 200,
- height: 200,
+ const SizedBox(height: 28),
+ _buildFeatureSlider(context),
+ const SizedBox(height: 2),
+ DotsIndicator(
+ dotsCount: 3,
+ position: _featureIndex.toInt(),
+ decorator: DotsDecorator(
+ activeColor: Colors.white,
+ color: Colors.white.withValues(alpha: 0.32),
+ activeShape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(14),
),
- const SizedBox(height: 12),
- const Text(
- "ente",
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontFamily: 'Montserrat',
- fontSize: 42,
- ),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(14),
),
- const SizedBox(height: 4),
- Text(
- "Authenticator",
- style: Theme.of(context).textTheme.headlineMedium,
- ),
- const SizedBox(height: 32),
- Text(
- l10n.onBoardingBody,
- textAlign: TextAlign.center,
- style: Theme.of(context)
- .textTheme
- .titleLarge!
- .copyWith(
- color: Colors.white38,
- ),
- ),
- ],
- ),
- const SizedBox(height: 100),
- Container(
- width: double.infinity,
- padding: const EdgeInsets.symmetric(horizontal: 20),
- child: GradientButton(
- onTap: _navigateToSignUpPage,
- text: l10n.newUser,
+ size: const Size(10, 10),
+ activeSize: const Size(20, 10),
+ spacing: const EdgeInsets.all(6),
),
),
- const SizedBox(height: 16),
- Container(
- height: 56,
- width: double.infinity,
- padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
- child: Hero(
- tag: "log_in",
- child: ElevatedButton(
- style: Theme.of(context)
- .colorScheme
- .optionalActionButtonStyle,
- onPressed: _navigateToSignInPage,
- child: Text(
- l10n.existingUser,
- style: const TextStyle(
- color: Colors.black, // same for both themes
+ const SizedBox(height: 48),
+ Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 28,
+ ),
+ child: Row(
+ children: [
+ Expanded(
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: const Color(0xFFb97dff),
+ foregroundColor: accentColor,
+ elevation: 0,
+ padding: const EdgeInsets.symmetric(
+ vertical: 18,
+ ),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(20),
+ ),
+ ),
+ onPressed: _navigateToSignUpPage,
+ child: Text(
+ l10n.signUp,
+ style: textTheme.bodyBold.copyWith(
+ color: Colors.white,
+ ),
+ ),
),
),
- ),
- ),
- ),
- const SizedBox(height: 4),
- Container(
- width: double.infinity,
- padding: const EdgeInsets.only(top: 20, bottom: 20),
- child: GestureDetector(
- onTap: _optForOfflineMode,
- child: Center(
- child: Text(
- l10n.useOffline,
- textAlign: TextAlign.center,
- style: body.copyWith(
- color: Theme.of(context)
- .colorScheme
- .mutedTextColor,
+ const SizedBox(width: 6),
+ Expanded(
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Colors.white,
+ foregroundColor: accentColor,
+ padding: const EdgeInsets.symmetric(
+ vertical: 18,
+ ),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(20),
+ ),
+ ),
+ onPressed: _navigateToSignInPage,
+ child: Text(
+ l10n.logInLabel,
+ style: textTheme.bodyBold.copyWith(
+ color: accentColor,
+ ),
+ ),
),
),
+ ],
+ ),
+ ),
+ const SizedBox(height: 8),
+ TextButton(
+ onPressed: _optForOfflineMode,
+ child: Text(
+ l10n.useOffline,
+ style: textTheme.bodyBold.copyWith(
+ color: Colors.white.withValues(alpha: 0.85),
+ decoration: TextDecoration.underline,
+ decorationColor: Colors.white,
),
),
),
+ const SizedBox(height: 16),
const DeveloperSettingsWidget(),
],
),
@@ -221,6 +224,32 @@ class _OnboardingPageState extends State<OnboardingPage> {
);
}
+ Future<void> _handleDeveloperTap(BuildContext context) async {
+ _developerModeTapCount++;
+ if (_developerModeTapCount >= kDeveloperModeTapCountThreshold) {
+ _developerModeTapCount = 0;
+ final result = await showChoiceDialog(
+ context,
+ title: context.l10n.developerSettings,
+ firstButtonLabel: context.l10n.yes,
+ body: context.l10n.developerSettingsWarning,
+ isDismissible: false,
+ );
+ if (result?.action == ButtonAction.first) {
+ await Navigator.of(context).push(
+ MaterialPageRoute(
+ builder: (BuildContext context) {
+ return const DeveloperSettingsPage();
+ },
+ ),
+ );
+ if (mounted) {
+ setState(() {});
+ }
+ }
+ }
+ }
+
Future<void> _optForOfflineMode() async {
bool canCheckBio = Platform.isMacOS ||
Platform.isLinux ||
@@ -257,6 +286,33 @@ class _OnboardingPageState extends State<OnboardingPage> {
}
}
+ Widget _buildFeatureSlider(BuildContext context) {
+ final l10n = context.l10n;
+ final features = [
+ ("assets/onboarding_lock.png", l10n.featureBackupCodes),
+ ("assets/onboarding_file.png", l10n.featureSearchEtc),
+ ("assets/onboarding_share.png", l10n.featureOpenSource),
+ ];
+ return ConstrainedBox(
+ constraints: const BoxConstraints(maxHeight: 320),
+ child: PageView(
+ children: features
+ .map(
+ (feature) => _FeatureItemWidget(
+ assetPath: feature.$1,
+ title: feature.$2,
+ ),
+ )
+ .toList(),
+ onPageChanged: (index) {
+ setState(() {
+ _featureIndex = index.toDouble();
+ });
+ },
+ ),
+ );
+ }
+
void _navigateToSignUpPage() {
Widget page;
if (Configuration.instance.getEncryptedToken() == null) {
@@ -324,3 +380,38 @@ class _OnboardingPageState extends State<OnboardingPage> {
);
}
}
+
+class _FeatureItemWidget extends StatelessWidget {
+ const _FeatureItemWidget({
+ required this.assetPath,
+ required this.title,
+ });
+
+ final String assetPath;
+ final String title;
+
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Image.asset(
+ assetPath,
+ height: 132,
+ ),
+ const SizedBox(height: 12),
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
+ child: Text(
+ title,
+ style: getEnteTextTheme(context).largeBold.copyWith(
+ color: Colors.white,
+ ),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ ],
+ );
+ }
+}
diff --git a/mobile/apps/auth/lib/theme/colors.dart b/mobile/apps/auth/lib/theme/colors.dart
index ccaaa869d1..399c614176 100644
--- a/mobile/apps/auth/lib/theme/colors.dart
+++ b/mobile/apps/auth/lib/theme/colors.dart
@@ -184,6 +184,8 @@ const EnteColorScheme darkScheme = EnteColorScheme(
_pinnedBgColorDark,
);
+const accentColor = Color(0xFFA75CFF);
+
// Background Colors
const Color backgroundBaseLight = Color.fromRGBO(255, 255, 255, 1);
const Color backgroundElevatedLight = Color.fromRGBO(255, 255, 255, 1);
diff --git a/mobile/apps/auth/pubspec.lock b/mobile/apps/auth/pubspec.lock
index 616629c74f..d75c6aec11 100644
--- a/mobile/apps/auth/pubspec.lock
+++ b/mobile/apps/auth/pubspec.lock
@@ -361,6 +361,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
+ dots_indicator:
+ dependency: "direct main"
+ description:
+ name: dots_indicator
+ sha256: "2a53e0321a3f0d87e38ef30f6e9ff1deb5d6c0e2c5708e057d26cdaa94a95f10"
+ url: "https://pub.dev"
+ source: hosted
+ version: "3.1.0"
dotted_border:
dependency: "direct main"
description:
diff --git a/mobile/apps/auth/pubspec.yaml b/mobile/apps/auth/pubspec.yaml
index a8e2f21a18..bbea85b4b3 100644
--- a/mobile/apps/auth/pubspec.yaml
+++ b/mobile/apps/auth/pubspec.yaml
@@ -20,6 +20,7 @@ dependencies:
convert: ^3.1.1
device_info_plus: ^9.1.1
dio: ^5.8.0+1
+ dots_indicator: ^3.0.0
dotted_border: ^3.1.0
dropdown_button2: ^2.3.9
email_validator: ^3.0.0