Skip to content

armgit / ente

Public Imported from GitHub
0

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

Apply width restrictions and UI improvements

Prateek Sunal672d402d5adf
diff --git a/mobile/apps/auth/lib/l10n/arb/app_en.arb b/mobile/apps/auth/lib/l10n/arb/app_en.arb
index 6d448b7802..07332f16c2 100644
--- a/mobile/apps/auth/lib/l10n/arb/app_en.arb
+++ b/mobile/apps/auth/lib/l10n/arb/app_en.arb
@@ -567,6 +567,7 @@
"clearBackupPassword": "Clear backup password",
"selectBackupFolder": "Select a backup folder",
"setBackupFolder": "Set backup folder",
+ "backupFolderLabel": "Backup folder:",
"backupPasswordHint": "Your backup will be encrypted with this password.",
"authToUpdateBackupPassword": "Authenticate to update backup password",
"authToSetBackupPassword": "Authenticate to set backup password",
diff --git a/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dart b/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dart
index 34d771db6f..53faa27cb2 100644
--- a/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dart
+++ b/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dart
@@ -2,6 +2,8 @@ import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:ente_auth/ui/components/captioned_text_widget.dart';
import 'package:ente_auth/ui/components/menu_item_widget.dart';
+import 'package:ente_auth/ui/components/title_bar_title_widget.dart';
+import 'package:ente_auth/ui/components/title_bar_widget.dart';
import 'package:ente_auth/ui/components/toggle_switch_widget.dart';
import 'package:ente_auth/ui/settings/data/local_backup/local_backup_experience.dart';
import 'package:flutter/foundation.dart';
@@ -20,11 +22,12 @@ class LocalBackupSettingsPage extends StatelessWidget {
return _LocalBackupVariantShell(
controller: controller,
title: l10n.localBackupSettingsTitle,
- body: SingleChildScrollView(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
+ body: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
+ const SizedBox(height: 24),
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: l10n.enableAutomaticBackups,
@@ -80,10 +83,33 @@ class LocalBackupSettingsPage extends StatelessWidget {
},
),
const SizedBox(height: 16),
- _BackupLocationCard(
- controller: controller,
- colorScheme: colorScheme,
- textTheme: textTheme,
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ MenuItemWidget(
+ captionedTextWidget: CaptionedTextWidget(
+ title: l10n.setBackupFolder,
+ ),
+ alignCaptionedTextToLeft: true,
+ singleBorderRadius: 12,
+ menuItemColor: colorScheme.fillFaint,
+ trailingIcon: Icons.chevron_right_outlined,
+ trailingIconIsMuted: true,
+ onTap: () async {
+ await controller.changeLocation();
+ },
+ ),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 12,
+ left: 12,
+ right: 12,
+ ),
+ child: _LocationPreview(
+ controller: controller,
+ ),
+ ),
+ ],
),
const SizedBox(height: 12),
MenuItemWidget(
@@ -157,21 +183,41 @@ class _LocalBackupVariantShell extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(title: Text(title)),
- body: Align(
- alignment: Alignment.topCenter,
- child: ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 700),
- child: Stack(
- children: [
- AnimatedSwitcher(
- duration: const Duration(milliseconds: 200),
- child: controller.hasLoaded
- ? SafeArea(bottom: false, child: body)
- : const _LocalBackupLoading(),
- ),
- ],
+ return Material(
+ color: Colors.transparent,
+ child: Scaffold(
+ body: Align(
+ alignment: Alignment.topCenter,
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 700),
+ child: Stack(
+ children: [
+ AnimatedSwitcher(
+ duration: const Duration(milliseconds: 200),
+ child: controller.hasLoaded
+ ? CustomScrollView(
+ primary: false,
+ slivers: <Widget>[
+ TitleBarWidget(
+ flexibleSpaceTitle: TitleBarTitleWidget(
+ title: title,
+ ),
+ actionIcons: const [],
+ ),
+ SliverList(
+ delegate: SliverChildBuilderDelegate(
+ (context, index) {
+ return SafeArea(bottom: false, child: body);
+ },
+ childCount: 1,
+ ),
+ ),
+ ],
+ )
+ : const _LocalBackupLoading(),
+ ),
+ ],
+ ),
),
),
),
@@ -196,67 +242,25 @@ class _LocationPreview extends StatelessWidget {
@override
Widget build(BuildContext context) {
final textTheme = getEnteTextTheme(context);
+ final l10n = context.l10n;
final path = controller.backupPath;
final treeUri = controller.backupTreeUri;
final muted = textTheme.miniFaint.copyWith(color: Colors.grey);
if (path != null) {
- return Text(controller.simplifyPath(path), style: textTheme.miniFaint);
+ return Text(
+ '${l10n.backupFolderLabel} ${controller.simplifyPath(path)}',
+ style: textTheme.miniFaint,
+ );
}
if (treeUri != null) {
return Text(
- controller.simplifyPath(treeUri),
+ '${l10n.backupFolderLabel} ${controller.simplifyPath(treeUri)}',
style: textTheme.miniFaint,
);
}
- return Text(context.l10n.selectBackupFolder, style: muted);
- }
-}
-
-class _BackupLocationCard extends StatelessWidget {
- const _BackupLocationCard({
- required this.controller,
- required this.colorScheme,
- required this.textTheme,
- });
-
- final LocalBackupExperienceController controller;
- final dynamic colorScheme;
- final dynamic textTheme;
-
- @override
- Widget build(BuildContext context) {
- return Material(
- color: colorScheme.fillFaint,
- borderRadius: BorderRadius.circular(12),
- child: GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: () async {
- await controller.changeLocation();
- },
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 16,
- vertical: 12,
- ),
- child: SizedBox(
- width: double.infinity,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- context.l10n.setBackupFolder,
- style: textTheme.body,
- ),
- const SizedBox(height: 6),
- _LocationPreview(controller: controller),
- ],
- ),
- ),
- ),
- ),
- );
+ return Text(l10n.selectBackupFolder, style: muted);
}
}
diff --git a/mobile/apps/auth/lib/ui/settings/developer_settings_page.dart b/mobile/apps/auth/lib/ui/settings/developer_settings_page.dart
index 5bd72be406..6de423db1c 100644
--- a/mobile/apps/auth/lib/ui/settings/developer_settings_page.dart
+++ b/mobile/apps/auth/lib/ui/settings/developer_settings_page.dart
@@ -33,45 +33,51 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
appBar: AppBar(
title: Text(context.l10n.developerSettings),
),
- body: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Column(
- children: [
- TextField(
- controller: _urlController,
- decoration: InputDecoration(
- labelText: context.l10n.serverEndpoint,
- hintText: Configuration.instance.getHttpEndpoint(),
- ),
- autofocus: true,
+ body: Align(
+ alignment: Alignment.topCenter,
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 700),
+ child: Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Column(
+ children: [
+ TextField(
+ controller: _urlController,
+ decoration: InputDecoration(
+ labelText: context.l10n.serverEndpoint,
+ hintText: Configuration.instance.getHttpEndpoint(),
+ ),
+ autofocus: true,
+ ),
+ const SizedBox(height: 40),
+ GradientButton(
+ onTap: () async {
+ String url = _urlController.text;
+ _logger.info("Entered endpoint: $url");
+ try {
+ final uri = Uri.parse(url);
+ if ((uri.scheme == "http" || uri.scheme == "https")) {
+ await _ping(url);
+ await Configuration.instance.setHttpEndpoint(url);
+ showToast(context, context.l10n.endpointUpdatedMessage);
+ Navigator.of(context).pop();
+ } else {
+ throw const FormatException();
+ }
+ } catch (e) {
+ // ignore: unawaited_futures
+ showErrorDialog(
+ context,
+ context.l10n.invalidEndpoint,
+ context.l10n.invalidEndpointMessage,
+ );
+ }
+ },
+ text: context.l10n.saveAction,
+ ),
+ ],
),
- const SizedBox(height: 40),
- GradientButton(
- onTap: () async {
- String url = _urlController.text;
- _logger.info("Entered endpoint: $url");
- try {
- final uri = Uri.parse(url);
- if ((uri.scheme == "http" || uri.scheme == "https")) {
- await _ping(url);
- await Configuration.instance.setHttpEndpoint(url);
- showToast(context, context.l10n.endpointUpdatedMessage);
- Navigator.of(context).pop();
- } else {
- throw const FormatException();
- }
- } catch (e) {
- // ignore: unawaited_futures
- showErrorDialog(
- context,
- context.l10n.invalidEndpoint,
- context.l10n.invalidEndpointMessage,
- );
- }
- },
- text: context.l10n.saveAction,
- ),
- ],
+ ),
),
),
);
diff --git a/mobile/packages/accounts/lib/pages/sessions_page.dart b/mobile/packages/accounts/lib/pages/sessions_page.dart
index 1e9409f7c3..a8a7219663 100644
--- a/mobile/packages/accounts/lib/pages/sessions_page.dart
+++ b/mobile/packages/accounts/lib/pages/sessions_page.dart
@@ -11,10 +11,7 @@ import 'package:logging/logging.dart';
class SessionsPage extends StatefulWidget {
final BaseConfiguration config;
- const SessionsPage(
- this.config, {
- super.key,
- });
+ const SessionsPage(this.config, {super.key});
@override
State<SessionsPage> createState() => _SessionsPageState();
@@ -35,11 +32,14 @@ class _SessionsPageState extends State<SessionsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
- appBar: AppBar(
- elevation: 0,
- title: Text(context.strings.activeSessions),
+ appBar: AppBar(elevation: 0, title: Text(context.strings.activeSessions)),
+ body: Align(
+ alignment: Alignment.topCenter,
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 700),
+ child: _getBody(),
+ ),
),
- body: _getBody(),
);
}
@@ -52,16 +52,13 @@ class _SessionsPageState extends State<SessionsPage> {
for (final session in _sessions!.sessions) {
rows.add(_getSessionWidget(session));
}
- return SingleChildScrollView(
- child: Column(
- children: rows,
- ),
- );
+ return SingleChildScrollView(child: Column(children: rows));
}
Widget _getSessionWidget(Session session) {
- final lastUsedTime =
- DateTime.fromMicrosecondsSinceEpoch(session.lastUsedTime);
+ final lastUsedTime = DateTime.fromMicrosecondsSinceEpoch(
+ session.lastUsedTime,
+ );
return Column(
children: [
InkWell(
@@ -82,10 +79,9 @@ class _SessionsPageState extends State<SessionsPage> {
child: Text(
session.ip,
style: TextStyle(
- color: Theme.of(context)
- .colorScheme
- .onSurface
- .withValues(alpha: 0.8),
+ color: Theme.of(
+ context,
+ ).colorScheme.onSurface.withValues(alpha: 0.8),
fontSize: 14,
),
),
@@ -95,10 +91,9 @@ class _SessionsPageState extends State<SessionsPage> {
child: Text(
getFormattedTime(lastUsedTime),
style: TextStyle(
- color: Theme.of(context)
- .colorScheme
- .onSurface
- .withValues(alpha: 0.8),
+ color: Theme.of(
+ context,
+ ).colorScheme.onSurface.withValues(alpha: 0.8),
fontSize: 12,
),
),
@@ -153,21 +148,14 @@ class _SessionsPageState extends State<SessionsPage> {
session.token == widget.config.getToken();
Widget text;
if (isLoggingOutFromThisDevice) {
- text = Text(
- context.strings.thisWillLogYouOutOfThisDevice,
- );
+ text = Text(context.strings.thisWillLogYouOutOfThisDevice);
} else {
text = SingleChildScrollView(
child: Column(
children: [
- Text(
- context.strings.thisWillLogYouOutOfTheFollowingDevice,
- ),
+ Text(context.strings.thisWillLogYouOutOfTheFollowingDevice),
const Padding(padding: EdgeInsets.all(8)),
- Text(
- session.ua,
- style: Theme.of(context).textTheme.bodySmall,
- ),
+ Text(session.ua, style: Theme.of(context).textTheme.bodySmall),
],
),
);
@@ -179,9 +167,7 @@ class _SessionsPageState extends State<SessionsPage> {
TextButton(
child: Text(
context.strings.terminate,
- style: const TextStyle(
- color: Colors.red,
- ),
+ style: const TextStyle(color: Colors.red),
),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop('dialog');
diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
index cc4b4b059a..ac8b2fe339 100644
--- a/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
@@ -50,10 +50,10 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
Future<void> _initializeSettings() async {
final bool passwordEnabled = await _lockScreenSettings.isPasswordSet();
final bool pinEnabled = await _lockScreenSettings.isPinSet();
- final bool shouldHideAppContent =
- _lockScreenSettings.getShouldHideAppContent();
- final bool systemLockEnabled =
- _lockScreenSettings.shouldShowSystemLockScreen();
+ final bool shouldHideAppContent = _lockScreenSettings
+ .getShouldHideAppContent();
+ final bool systemLockEnabled = _lockScreenSettings
+ .shouldShowSystemLockScreen();
setState(() {
isPasswordEnabled = passwordEnabled;
isPinEnabled = pinEnabled;
@@ -139,16 +139,11 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
}
Future<void> _onAutoLock() async {
- await routeToPage(
- context,
- const LockScreenAutoLock(),
- ).then(
- (value) {
- setState(() {
- autoLockTimeInMilliseconds = _lockScreenSettings.getAutoLockTime();
- });
- },
- );
+ await routeToPage(context, const LockScreenAutoLock()).then((value) {
+ setState(() {
+ autoLockTimeInMilliseconds = _lockScreenSettings.getAutoLockTime();
+ });
+ });
}
Future<void> _onHideContent() async {
@@ -175,211 +170,221 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
final colorTheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
return Scaffold(
- body: CustomScrollView(
- primary: false,
- slivers: <Widget>[
- TitleBarWidget(
- flexibleSpaceTitle: TitleBarTitleWidget(
- title: context.strings.appLock,
- ),
- ),
- SliverList(
- delegate: SliverChildBuilderDelegate(
- (context, index) {
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 20),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- MenuItemWidget(
- captionedTextWidget: CaptionedTextWidget(
- title: context.strings.appLock,
+ body: Align(
+ alignment: Alignment.topCenter,
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 700),
+ child: CustomScrollView(
+ primary: false,
+ slivers: <Widget>[
+ TitleBarWidget(
+ flexibleSpaceTitle: TitleBarTitleWidget(
+ title: context.strings.appLock,
+ ),
+ ),
+ SliverList(
+ delegate: SliverChildBuilderDelegate((context, index) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 20),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ MenuItemWidget(
+ captionedTextWidget: CaptionedTextWidget(
+ title: context.strings.appLock,
+ ),
+ alignCaptionedTextToLeft: true,
+ singleBorderRadius: 8,
+ menuItemColor: colorTheme.fillFaint,
+ trailingWidget: ToggleSwitchWidget(
+ value: () => appLock,
+ onChanged: () => _onToggleSwitch(),
+ ),
),
- alignCaptionedTextToLeft: true,
- singleBorderRadius: 8,
- menuItemColor: colorTheme.fillFaint,
- trailingWidget: ToggleSwitchWidget(
- value: () => appLock,
- onChanged: () => _onToggleSwitch(),
+ AnimatedSwitcher(
+ duration: const Duration(milliseconds: 210),
+ switchInCurve: Curves.easeOut,
+ switchOutCurve: Curves.easeIn,
+ child: !appLock
+ ? Padding(
+ padding: const EdgeInsets.only(
+ top: 14,
+ left: 14,
+ right: 12,
+ ),
+ child: Text(
+ context.strings.appLockDescription,
+ style: textTheme.miniFaint,
+ textAlign: TextAlign.left,
+ ),
+ )
+ : const SizedBox(),
),
- ),
- AnimatedSwitcher(
- duration: const Duration(milliseconds: 210),
- switchInCurve: Curves.easeOut,
- switchOutCurve: Curves.easeIn,
- child: !appLock
- ? Padding(
- padding: const EdgeInsets.only(
- top: 14,
- left: 14,
- right: 12,
+ const Padding(padding: EdgeInsets.only(top: 24)),
+ ],
+ ),
+ AnimatedSwitcher(
+ duration: const Duration(milliseconds: 210),
+ switchInCurve: Curves.easeOut,
+ switchOutCurve: Curves.easeIn,
+ child: appLock
+ ? Column(
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ children: [
+ MenuItemWidget(
+ captionedTextWidget:
+ CaptionedTextWidget(
+ title: context.strings.deviceLock,
+ ),
+ surfaceExecutionStates: false,
+ alignCaptionedTextToLeft: true,
+ isTopBorderRadiusRemoved: false,
+ isBottomBorderRadiusRemoved: true,
+ menuItemColor: colorTheme.fillFaint,
+ trailingIcon: isSystemLockEnabled
+ ? Icons.check
+ : null,
+ trailingIconColor: colorTheme.textBase,
+ onTap: () => _deviceLock(),
),
- child: Text(
- context.strings.appLockDescription,
- style: textTheme.miniFaint,
- textAlign: TextAlign.left,
+ DividerWidget(
+ dividerType: DividerType.menuNoIcon,
+ bgColor: colorTheme.fillFaint,
),
- )
- : const SizedBox(),
- ),
- const Padding(
- padding: EdgeInsets.only(top: 24),
- ),
- ],
- ),
- AnimatedSwitcher(
- duration: const Duration(milliseconds: 210),
- switchInCurve: Curves.easeOut,
- switchOutCurve: Curves.easeIn,
- child: appLock
+ MenuItemWidget(
+ captionedTextWidget:
+ CaptionedTextWidget(
+ title: context.strings.pinLock,
+ ),
+ surfaceExecutionStates: false,
+ alignCaptionedTextToLeft: true,
+ isTopBorderRadiusRemoved: true,
+ isBottomBorderRadiusRemoved: true,
+ menuItemColor: colorTheme.fillFaint,
+ trailingIcon: isPinEnabled
+ ? Icons.check
+ : null,
+ trailingIconColor: colorTheme.textBase,
+ onTap: () => _pinLock(),
+ ),
+ DividerWidget(
+ dividerType: DividerType.menuNoIcon,
+ bgColor: colorTheme.fillFaint,
+ ),
+ MenuItemWidget(
+ captionedTextWidget:
+ CaptionedTextWidget(
+ title: context.strings.password,
+ ),
+ surfaceExecutionStates: false,
+ alignCaptionedTextToLeft: true,
+ isTopBorderRadiusRemoved: true,
+ isBottomBorderRadiusRemoved: false,
+ menuItemColor: colorTheme.fillFaint,
+ trailingIcon: isPasswordEnabled
+ ? Icons.check
+ : null,
+ trailingIconColor: colorTheme.textBase,
+ onTap: () => _passwordLock(),
+ ),
+ const SizedBox(height: 24),
+ PlatformUtil.isMobile()
+ ? MenuItemWidget(
+ captionedTextWidget:
+ CaptionedTextWidget(
+ title: context
+ .strings
+ .autoLock,
+ subTitle: _formatTime(
+ Duration(
+ milliseconds:
+ autoLockTimeInMilliseconds,
+ ),
+ ),
+ ),
+ surfaceExecutionStates: false,
+ alignCaptionedTextToLeft: true,
+ singleBorderRadius: 8,
+ menuItemColor:
+ colorTheme.fillFaint,
+ trailingIconColor:
+ colorTheme.textBase,
+ onTap: () => _onAutoLock(),
+ )
+ : const SizedBox.shrink(),
+ PlatformUtil.isMobile()
+ ? Padding(
+ padding: const EdgeInsets.only(
+ top: 14,
+ left: 14,
+ right: 12,
+ ),
+ child: Text(
+ context
+ .strings
+ .autoLockFeatureDescription,
+ style: textTheme.miniFaint,
+ textAlign: TextAlign.left,
+ ),
+ )
+ : const SizedBox.shrink(),
+ ],
+ )
+ : const SizedBox.shrink(),
+ ),
+ PlatformUtil.isMobile()
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
+ SizedBox(height: appLock ? 24 : 8),
MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
- title: context.strings.deviceLock,
+ title: context.strings.hideContent,
),
- surfaceExecutionStates: false,
alignCaptionedTextToLeft: true,
- isTopBorderRadiusRemoved: false,
- isBottomBorderRadiusRemoved: true,
+ singleBorderRadius: 8,
menuItemColor: colorTheme.fillFaint,
- trailingIcon: isSystemLockEnabled
- ? Icons.check
- : null,
- trailingIconColor: colorTheme.textBase,
- onTap: () => _deviceLock(),
- ),
- DividerWidget(
- dividerType: DividerType.menuNoIcon,
- bgColor: colorTheme.fillFaint,
- ),
- MenuItemWidget(
- captionedTextWidget: CaptionedTextWidget(
- title: context.strings.pinLock,
+ trailingWidget: ToggleSwitchWidget(
+ value: () => hideAppContent,
+ onChanged: () => _onHideContent(),
),
- surfaceExecutionStates: false,
- alignCaptionedTextToLeft: true,
- isTopBorderRadiusRemoved: true,
- isBottomBorderRadiusRemoved: true,
- menuItemColor: colorTheme.fillFaint,
- trailingIcon:
- isPinEnabled ? Icons.check : null,
- trailingIconColor: colorTheme.textBase,
- onTap: () => _pinLock(),
- ),
- DividerWidget(
- dividerType: DividerType.menuNoIcon,
- bgColor: colorTheme.fillFaint,
),
- MenuItemWidget(
- captionedTextWidget: CaptionedTextWidget(
- title: context.strings.password,
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 14,
+ left: 14,
+ right: 12,
+ ),
+ child: Text(
+ Platform.isAndroid
+ ? context
+ .strings
+ .hideContentDescriptionAndroid
+ : context
+ .strings
+ .hideContentDescriptioniOS,
+ style: textTheme.miniFaint,
+ textAlign: TextAlign.left,
),
- surfaceExecutionStates: false,
- alignCaptionedTextToLeft: true,
- isTopBorderRadiusRemoved: true,
- isBottomBorderRadiusRemoved: false,
- menuItemColor: colorTheme.fillFaint,
- trailingIcon: isPasswordEnabled
- ? Icons.check
- : null,
- trailingIconColor: colorTheme.textBase,
- onTap: () => _passwordLock(),
- ),
- const SizedBox(
- height: 24,
),
- PlatformUtil.isMobile()
- ? MenuItemWidget(
- captionedTextWidget:
- CaptionedTextWidget(
- title: context.strings.autoLock,
- subTitle: _formatTime(
- Duration(
- milliseconds:
- autoLockTimeInMilliseconds,
- ),
- ),
- ),
- surfaceExecutionStates: false,
- alignCaptionedTextToLeft: true,
- singleBorderRadius: 8,
- menuItemColor: colorTheme.fillFaint,
- trailingIconColor:
- colorTheme.textBase,
- onTap: () => _onAutoLock(),
- )
- : const SizedBox.shrink(),
- PlatformUtil.isMobile()
- ? Padding(
- padding: const EdgeInsets.only(
- top: 14,
- left: 14,
- right: 12,
- ),
- child: Text(
- context.strings
- .autoLockFeatureDescription,
- style: textTheme.miniFaint,
- textAlign: TextAlign.left,
- ),
- )
- : const SizedBox.shrink(),
],
)
: const SizedBox.shrink(),
- ),
- PlatformUtil.isMobile()
- ? Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- SizedBox(height: appLock ? 24 : 8),
- MenuItemWidget(
- captionedTextWidget: CaptionedTextWidget(
- title: context.strings.hideContent,
- ),
- alignCaptionedTextToLeft: true,
- singleBorderRadius: 8,
- menuItemColor: colorTheme.fillFaint,
- trailingWidget: ToggleSwitchWidget(
- value: () => hideAppContent,
- onChanged: () => _onHideContent(),
- ),
- ),
- Padding(
- padding: const EdgeInsets.only(
- top: 14,
- left: 14,
- right: 12,
- ),
- child: Text(
- Platform.isAndroid
- ? context.strings
- .hideContentDescriptionAndroid
- : context.strings
- .hideContentDescriptioniOS,
- style: textTheme.miniFaint,
- textAlign: TextAlign.left,
- ),
- ),
- ],
- )
- : const SizedBox.shrink(),
- ],
+ ],
+ ),
),
- ),
- );
- },
- childCount: 1,
- ),
+ );
+ }, childCount: 1),
+ ),
+ ],
),
- ],
+ ),
),
);
}