Skip to content

armgit / ente

Public Imported from GitHub
0

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

Constrain Auth settings width on desktop

Neeraj Gupta845719ad29ba
diff --git a/mobile/apps/auth/lib/ui/settings/components/auth_settings_page_scaffold.dart b/mobile/apps/auth/lib/ui/settings/components/auth_settings_page_scaffold.dart
index c07587ad59..c9032d9fcc 100644
--- a/mobile/apps/auth/lib/ui/settings/components/auth_settings_page_scaffold.dart
+++ b/mobile/apps/auth/lib/ui/settings/components/auth_settings_page_scaffold.dart
@@ -1,3 +1,5 @@
+import 'dart:math' as math;
+
import 'package:ente_components/ente_components.dart';
import 'package:flutter/material.dart';
@@ -19,22 +21,39 @@ class AuthSettingsPageScaffold extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colors = context.componentColors;
- return Scaffold(
- backgroundColor: colors.backgroundBase,
- body: AppBarComponent(
- title: title,
- subtitle: subtitle,
- backButton: backButton,
- slivers: [
- SliverSafeArea(
- top: false,
- sliver: SliverPadding(
- padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
- sliver: SliverList.list(children: children),
- ),
+ return LayoutBuilder(
+ builder: (context, constraints) {
+ final horizontalPadding = math.max(
+ Spacing.lg,
+ (constraints.maxWidth - _maxContentWidth) / 2,
+ );
+
+ return Scaffold(
+ backgroundColor: colors.backgroundBase,
+ body: AppBarComponent(
+ title: title,
+ subtitle: subtitle,
+ backButton: backButton,
+ horizontalPadding: horizontalPadding,
+ slivers: [
+ SliverSafeArea(
+ top: false,
+ sliver: SliverPadding(
+ padding: EdgeInsets.fromLTRB(
+ horizontalPadding,
+ 0,
+ horizontalPadding,
+ Spacing.lg,
+ ),
+ sliver: SliverList.list(children: children),
+ ),
+ ),
+ ],
),
- ],
- ),
+ );
+ },
);
}
}
+
+const double _maxContentWidth = 720;