π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Redesign auth empty home screen with new layout and icons
Prateek Sunal18ff4cf8bed5
diff --git a/mobile/apps/auth/assets/svg/empty-state-bg-dark.svg b/mobile/apps/auth/assets/svg/empty-state-bg-dark.svgnew file mode 100644index 0000000000..6748dde3f4--- /dev/null+++ b/mobile/apps/auth/assets/svg/empty-state-bg-dark.svg@@ -0,0 +1,3 @@+<svg width="224" height="142" viewBox="0 0 224 142" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M54.3185 4.13779C17.9941 6.98869 3.84278 25.6433 1.10054 64.0293C-1.6417 102.415 -3.15604 135.074 46.7282 139.739C96.6124 144.403 164.35 140.533 190.704 139.739C215.071 133.853 229.951 107.037 221.716 60.4805C213.481 13.9243 164.79 -0.239729 130.012 0.00305793C95.2352 0.245844 54.3185 4.14147 54.3185 4.14147V4.13779Z" fill="#F4EBFF" fill-opacity="0.35"/>+</svg>diff --git a/mobile/apps/auth/assets/svg/empty-state-bg-light.svg b/mobile/apps/auth/assets/svg/empty-state-bg-light.svgnew file mode 100644index 0000000000..8edfc5ff09--- /dev/null+++ b/mobile/apps/auth/assets/svg/empty-state-bg-light.svg@@ -0,0 +1,3 @@+<svg width="224" height="142" viewBox="0 0 224 142" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M54.3185 4.13779C17.9941 6.98869 3.84278 25.6433 1.10054 64.0293C-1.6417 102.415 -3.15604 135.074 46.7282 139.739C96.6124 144.403 164.35 140.533 190.704 139.739C215.071 133.853 229.951 107.037 221.716 60.4805C213.481 13.9243 164.79 -0.239729 130.012 0.00305793C95.2352 0.245844 54.3185 4.14147 54.3185 4.14147V4.13779Z" fill="#FBF8FF"/>+</svg>diff --git a/mobile/apps/auth/assets/svg/filter-icon.svg b/mobile/apps/auth/assets/svg/filter-icon.svgnew file mode 100644index 0000000000..a4ba767097--- /dev/null+++ b/mobile/apps/auth/assets/svg/filter-icon.svg@@ -0,0 +1,5 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M4.5 7H19.5" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M7 12H17" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M9.5 17H14.5" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/mobile/apps/auth/assets/svg/menu-icon.svg b/mobile/apps/auth/assets/svg/menu-icon.svgnew file mode 100644index 0000000000..c0f3612724--- /dev/null+++ b/mobile/apps/auth/assets/svg/menu-icon.svg@@ -0,0 +1,5 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M5.33203 6.16602H18.6654" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M5.33203 12H18.6654" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M5.33203 17.834H18.6654" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/mobile/apps/auth/assets/svg/search-icon.svg b/mobile/apps/auth/assets/svg/search-icon.svgnew file mode 100644index 0000000000..a2761913de--- /dev/null+++ b/mobile/apps/auth/assets/svg/search-icon.svg@@ -0,0 +1,4 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M16.168 16.166L19.5013 19.4993" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M17.8333 11.1667C17.8333 7.48477 14.8486 4.5 11.1667 4.5C7.48477 4.5 4.5 7.48477 4.5 11.1667C4.5 14.8486 7.48477 17.8333 11.1667 17.8333C14.8486 17.8333 17.8333 14.8486 17.8333 11.1667Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/mobile/apps/auth/lib/l10n/arb/app_en.arb b/mobile/apps/auth/lib/l10n/arb/app_en.arbindex 86bcd2ce62..a6be9ae526 100644--- a/mobile/apps/auth/lib/l10n/arb/app_en.arb+++ b/mobile/apps/auth/lib/l10n/arb/app_en.arb@@ -12,7 +12,7 @@"featureOpenSource": "Open source and\naudited by security experts","signUp": "Sign up","onBoardingGetStarted": "Get Started",- "setupFirstAccount": "Setup your first account",+ "setupFirstAccount": "Setup your first\naccount","allTabEmptyHint": "Nothing here yet. Tap + to add a code or open Trash to recover one.","@allTabEmptyHint": {"description": "Shown when the All tab has no active codes but Trash contains codes"diff --git a/mobile/apps/auth/lib/ui/home/home_empty_state.dart b/mobile/apps/auth/lib/ui/home/home_empty_state.dartindex 9097e6689a..dc9e69980b 100644--- a/mobile/apps/auth/lib/ui/home/home_empty_state.dart+++ b/mobile/apps/auth/lib/ui/home/home_empty_state.dart@@ -1,10 +1,11 @@import 'package:ente_auth/l10n/l10n.dart';import 'package:ente_auth/theme/ente_theme.dart';+import 'package:ente_auth/ui/home/widgets/rounded_action_buttons.dart';import 'package:ente_auth/ui/settings/data/import_page.dart';import 'package:ente_auth/utils/navigation_util.dart';import 'package:ente_auth/utils/platform_util.dart';import 'package:flutter/material.dart';-import 'package:logging/logging.dart';+import 'package:flutter_svg/flutter_svg.dart';class HomeEmptyStateWidget extends StatelessWidget {final VoidCallback? onScanTap;@@ -19,101 +20,122 @@ class HomeEmptyStateWidget extends StatelessWidget {@overrideWidget build(BuildContext context) {final l10n = context.l10n;- return SingleChildScrollView(- child: Center(- child: ConstrainedBox(- constraints: BoxConstraints(- minHeight: MediaQuery.of(context).size.height,- minWidth: 450,- ),+ final colorScheme = getEnteColorScheme(context);+ final isDarkTheme = !colorScheme.isLightTheme;+ final bgSvgPath = isDarkTheme+ ? 'assets/svg/empty-state-bg-dark.svg'+ : 'assets/svg/empty-state-bg-light.svg';++ return CustomScrollView(+ physics: const BouncingScrollPhysics(),+ slivers: [+ SliverFillRemaining(+ hasScrollBody: false,child: Padding(- padding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 40),+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 24),child: Column(- mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [- Column(- children: [- Image.asset(- "assets/wallet-front-gradient.png",- width: 200,- height: 200,- ),- Text(- l10n.setupFirstAccount,- textAlign: TextAlign.center,- style: Theme.of(context).textTheme.headlineMedium,- ),- const SizedBox(height: 64),- if (PlatformUtil.isMobile())+ Expanded(+ child: Column(+ mainAxisAlignment: MainAxisAlignment.center,+ children: [SizedBox(- width: 400,- child: OutlinedButton(- onPressed: onScanTap,- style: OutlinedButton.styleFrom(- padding: const EdgeInsets.symmetric(vertical: 0),- ),- child: Text(- l10n.importScanQrCode,- textAlign: TextAlign.center,- ),+ height: 188,+ child: Stack(+ alignment: Alignment.center,+ clipBehavior: Clip.none,+ children: [+ Positioned(+ bottom: 6,+ child: SvgPicture.asset(+ bgSvgPath,+ width: 224,+ height: 142,+ ),+ ),+ Image.asset(+ 'assets/onboarding-2.png',+ height: 188,+ ),+ ],),),- const SizedBox(height: 18),- SizedBox(- width: 400,- child: OutlinedButton(- onPressed: onManuallySetupTap,- style: OutlinedButton.styleFrom(- padding: const EdgeInsets.symmetric(vertical: 0),- ),+ const SizedBox(height: 32),+ SizedBox(+ width: 221,child: Text(- l10n.importEnterSetupKey,+ l10n.setupFirstAccount,textAlign: TextAlign.center,+ style: TextStyle(+ color: colorScheme.textBase,+ fontSize: 20,+ fontFamily: 'Inter',+ fontWeight: FontWeight.w700,+ height: 1.05,+ letterSpacing: -1,+ ),),),+ ],+ ),+ ),+ const SizedBox(height: 48),+ Center(+ child: ConstrainedBox(+ constraints: const BoxConstraints(maxWidth: 360),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ if (PlatformUtil.isMobile()) ...[+ PrimaryRoundedButton(+ label: l10n.importScanQrCode,+ onPressed: onScanTap,+ width: double.infinity,+ ),+ const SizedBox(height: 12),+ SecondaryRoundedButton(+ label: l10n.importEnterSetupKey,+ onPressed: onManuallySetupTap,+ width: double.infinity,+ ),+ ] else+ PrimaryRoundedButton(+ label: l10n.importEnterSetupKey,+ onPressed: onManuallySetupTap,+ width: double.infinity,+ ),+ const SizedBox(height: 16),+ Row(+ mainAxisAlignment: MainAxisAlignment.spaceBetween,+ children: [+ TextLinkButton(+ label: l10n.importCodes,+ onTap: () {+ routeToPage(context, const ImportCodePage());+ },+ ),+ TextLinkButton(+ label: l10n.faq,+ onTap: () {+ PlatformUtil.openWebView(+ context,+ context.l10n.faq,+ 'https://ente.io/help/auth/faq',+ );+ },+ ),+ ],+ ),+ ],),- const SizedBox(height: 54),- InkWell(- onTap: () {- routeToPage(context, const ImportCodePage());- },- child: Text(- l10n.importCodes,- textAlign: TextAlign.center,- style: getEnteTextTheme(context)- .bodyFaint- .copyWith(decoration: TextDecoration.underline),- ),- ),- const SizedBox(height: 18),- InkWell(- onTap: () {- try {- PlatformUtil.openWebView(- context,- context.l10n.faq,- "https://ente.io/help/auth/faq",- );- } catch (e) {- Logger("HomeEmptyStateWidget")- .severe("Failed to open FAQ", e);- }- },- child: Text(- l10n.faq,- textAlign: TextAlign.center,- style: getEnteTextTheme(context)- .bodyFaint- .copyWith(decoration: TextDecoration.underline),- ),- ),- ],+ ),),],),),),- ),+ ],);}}diff --git a/mobile/apps/auth/lib/ui/home/widgets/auth_logo_widget.dart b/mobile/apps/auth/lib/ui/home/widgets/auth_logo_widget.dartnew file mode 100644index 0000000000..922ee95fff--- /dev/null+++ b/mobile/apps/auth/lib/ui/home/widgets/auth_logo_widget.dart@@ -0,0 +1,26 @@+import 'package:ente_auth/theme/ente_theme.dart';+import 'package:flutter/material.dart';+import 'package:flutter_svg/flutter_svg.dart';++class AuthLogoWidget extends StatelessWidget {+ final double height;+ final Color? color;++ const AuthLogoWidget({+ super.key,+ this.height = 18,+ this.color,+ });++ @override+ Widget build(BuildContext context) {+ final colorScheme = getEnteColorScheme(context);+ final logoColor = color ?? colorScheme.textBase;++ return SvgPicture.asset(+ 'assets/svg/auth-logo.svg',+ height: height,+ colorFilter: ColorFilter.mode(logoColor, BlendMode.srcIn),+ );+ }+}diff --git a/mobile/apps/auth/lib/ui/home/widgets/rounded_action_buttons.dart b/mobile/apps/auth/lib/ui/home/widgets/rounded_action_buttons.dartnew file mode 100644index 0000000000..49e645ff3e--- /dev/null+++ b/mobile/apps/auth/lib/ui/home/widgets/rounded_action_buttons.dart@@ -0,0 +1,123 @@+import 'package:ente_auth/theme/colors.dart';+import 'package:ente_auth/theme/ente_theme.dart';+import 'package:flutter/material.dart';++class PrimaryRoundedButton extends StatelessWidget {+ final String label;+ final VoidCallback? onPressed;+ final double? width;++ const PrimaryRoundedButton({+ super.key,+ required this.label,+ required this.onPressed,+ this.width,+ });++ @override+ Widget build(BuildContext context) {+ final textTheme = getEnteTextTheme(context);++ return GestureDetector(+ onTap: onPressed,+ child: Container(+ width: width,+ height: 56,+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 18),+ decoration: ShapeDecoration(+ color: accentColor,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(20),+ ),+ ),+ child: Center(+ child: Text(+ label,+ style: textTheme.small.copyWith(+ color: Colors.white,+ fontWeight: FontWeight.w600,+ ),+ ),+ ),+ ),+ );+ }+}++class SecondaryRoundedButton extends StatelessWidget {+ final String label;+ final VoidCallback? onPressed;+ final double? width;++ const SecondaryRoundedButton({+ super.key,+ required this.label,+ required this.onPressed,+ this.width,+ });++ @override+ Widget build(BuildContext context) {+ final textTheme = getEnteTextTheme(context);+ final colorScheme = getEnteColorScheme(context);+ final isDarkTheme = !colorScheme.isLightTheme;+ final backgroundColor =+ isDarkTheme ? const Color(0x29A75CFF) : const Color(0x0AA75CFF);++ return GestureDetector(+ onTap: onPressed,+ child: Container(+ width: width,+ height: 56,+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 18),+ decoration: ShapeDecoration(+ color: backgroundColor,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(20),+ ),+ ),+ child: Center(+ child: Text(+ label,+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ fontWeight: FontWeight.w600,+ ),+ ),+ ),+ ),+ );+ }+}++class TextLinkButton extends StatelessWidget {+ final String label;+ final VoidCallback? onTap;++ const TextLinkButton({+ super.key,+ required this.label,+ required this.onTap,+ });++ @override+ Widget build(BuildContext context) {+ final textTheme = getEnteTextTheme(context);+ final colorScheme = getEnteColorScheme(context);++ return GestureDetector(+ onTap: onTap,+ child: Padding(+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 18),+ child: Text(+ label,+ style: textTheme.small.copyWith(+ color: colorScheme.textBase,+ fontWeight: FontWeight.w600,+ decoration: TextDecoration.underline,+ ),+ ),+ ),+ );+ }+}diff --git a/mobile/apps/auth/lib/ui/home_page.dart b/mobile/apps/auth/lib/ui/home_page.dartindex 410a272410..2a403bc94f 100644--- a/mobile/apps/auth/lib/ui/home_page.dart+++ b/mobile/apps/auth/lib/ui/home_page.dart@@ -21,7 +21,6 @@ import 'package:ente_auth/store/code_display_store.dart';import 'package:ente_auth/store/code_store.dart';import 'package:ente_auth/theme/colors.dart';import 'package:ente_auth/theme/ente_theme.dart';-import 'package:ente_auth/theme/text_style.dart';import 'package:ente_auth/ui/account/logout_dialog.dart';import 'package:ente_auth/ui/code_error_widget.dart';import 'package:ente_auth/ui/code_widget.dart';@@ -34,6 +33,7 @@ import 'package:ente_auth/ui/home/add_tag_sheet.dart';import 'package:ente_auth/ui/home/coach_mark_widget.dart';import 'package:ente_auth/ui/home/home_empty_state.dart';import 'package:ente_auth/ui/home/speed_dial_label_widget.dart';+import 'package:ente_auth/ui/home/widgets/auth_logo_widget.dart';import 'package:ente_auth/ui/reorder_codes_page.dart';import 'package:ente_auth/ui/scanner_page.dart';import 'package:ente_auth/ui/settings_page.dart';@@ -56,6 +56,7 @@ import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:flutter_speed_dial/flutter_speed_dial.dart';import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';+import 'package:flutter_svg/flutter_svg.dart';import 'package:hugeicons/hugeicons.dart';import 'package:logging/logging.dart';import 'package:move_to_background/move_to_background.dart';@@ -1357,11 +1358,26 @@ class _HomePageState extends State<HomePage> {AppLocalizations l10n,bool isDesktop,) {+ final colorScheme = getEnteColorScheme(context);+ final iconColor = colorScheme.textBase;+return AppBar(backgroundColor: Theme.of(context).scaffoldBackgroundColor,surfaceTintColor: Colors.transparent,+ leading: IconButton(+ icon: SvgPicture.asset(+ 'assets/svg/menu-icon.svg',+ width: 24,+ height: 24,+ colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),+ ),+ tooltip: l10n.settings,+ onPressed: () {+ scaffoldKey.currentState?.openDrawer();+ },+ ),title: !_showSearchBox- ? const Text('Ente Auth', style: brandStyleMedium)+ ? const AuthLogoWidget(height: 18): TextField(autocorrect: false,enableSuggestions: false,@@ -1378,7 +1394,7 @@ class _HomePageState extends State<HomePage> {),focusNode: searchBoxFocusNode,),- centerTitle: isDesktop ? false : true,+ centerTitle: true,actions: <Widget>[Padding(padding: const EdgeInsets.all(8.0),@@ -1396,6 +1412,7 @@ class _HomePageState extends State<HomePage> {_applyFilteringAndRefresh();}},+ iconColor: iconColor,),),if (isDesktop)@@ -1409,8 +1426,13 @@ class _HomePageState extends State<HomePage> {),IconButton(icon: _showSearchBox- ? const Icon(Icons.clear)- : const Icon(Icons.search),+ ? Icon(Icons.clear, color: iconColor)+ : SvgPicture.asset(+ 'assets/svg/search-icon.svg',+ width: 24,+ height: 24,+ colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),+ ),tooltip: l10n.search,padding: const EdgeInsets.all(8.0),onPressed: () {diff --git a/mobile/apps/auth/lib/ui/sort_option_menu.dart b/mobile/apps/auth/lib/ui/sort_option_menu.dartindex 1530455a02..d2f938176d 100644--- a/mobile/apps/auth/lib/ui/sort_option_menu.dart+++ b/mobile/apps/auth/lib/ui/sort_option_menu.dart@@ -1,14 +1,18 @@import 'package:ente_auth/l10n/l10n.dart';import 'package:ente_auth/services/preference_service.dart';import 'package:flutter/material.dart';+import 'package:flutter_svg/flutter_svg.dart';class SortCodeMenuWidget extends StatelessWidget {final CodeSortKey currentKey;final void Function(CodeSortKey) onSelected;+ final Color? iconColor;+const SortCodeMenuWidget({super.key,required this.currentKey,required this.onSelected,+ this.iconColor,});@override@@ -71,7 +75,14 @@ class SortCodeMenuWidget extends StatelessWidget {onSelected(CodeSortKey.values[selectedValue]);}},- child: const Icon(Icons.sort_outlined),+ child: SvgPicture.asset(+ 'assets/svg/filter-icon.svg',+ width: 24,+ height: 24,+ colorFilter: iconColor != null+ ? ColorFilter.mode(iconColor!, BlendMode.srcIn)+ : null,+ ),);}}diff --git a/mobile/apps/auth/scripts/internal_changes.txt b/mobile/apps/auth/scripts/internal_changes.txtindex 899bf0e75f..ad4c8b854a 100644--- a/mobile/apps/auth/scripts/internal_changes.txt+++ b/mobile/apps/auth/scripts/internal_changes.txt@@ -1 +1,2 @@- Prateek: Revamped QR code dialog with new design, shared package for auth and photos, dark mode support, and responsive layout+- Prateek: Redesigned empty home screen with new layout, custom icons, and rounded buttons