Skip to content

armgit / ente

Public Imported from GitHub
0

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

Remove unnecessary formatting changes from constraint widget updates

Prateek Sunal7578196d50cd
diff --git a/mobile/packages/accounts/lib/pages/sessions_page.dart b/mobile/packages/accounts/lib/pages/sessions_page.dart
index ef0cd28ae3..8dfa88b2ae 100644
--- a/mobile/packages/accounts/lib/pages/sessions_page.dart
+++ b/mobile/packages/accounts/lib/pages/sessions_page.dart
@@ -12,7 +12,10 @@ 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();
@@ -33,7 +36,10 @@ 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: CenteredConstrainedWidget(
child: _getBody(),
),
@@ -49,13 +55,16 @@ 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(
@@ -76,9 +85,10 @@ 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,
),
),
@@ -88,9 +98,10 @@ 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,
),
),
@@ -145,14 +156,21 @@ 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,
+ ),
],
),
);
@@ -164,7 +182,9 @@ 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 3ef42933a2..a237173dcd 100644
--- a/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
@@ -140,11 +140,16 @@ 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 {
@@ -179,192 +184,200 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
),
),
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,
+ 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,
+ ),
),
],
),