Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 83 additions & 67 deletions app/lib/pages/onboarding/ai_consent_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,82 +36,98 @@ class _AiConsentWidgetState extends State<AiConsentWidget> {

@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
return Column(
children: [
Expanded(child: Container()),
Container(
width: double.infinity,
padding: EdgeInsets.fromLTRB(32, 26, 32, MediaQuery.of(context).padding.bottom + 8),
decoration: const BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.only(topLeft: Radius.circular(40), topRight: Radius.circular(40)),
ConstrainedBox(
constraints: BoxConstraints(
maxHeight: mediaQuery.size.height - mediaQuery.padding.top - 16,
),
child: SafeArea(
top: false,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.l10n.dataAndPrivacy,
style: const TextStyle(
color: Colors.white,
fontSize: 28,
fontWeight: FontWeight.bold,
height: 1.2,
fontFamily: 'Manrope',
),
),
const SizedBox(height: 16),
Text(
context.l10n.consentDataMessage,
style: const TextStyle(color: Colors.white, fontSize: 15, height: 1.5, fontFamily: 'Manrope'),
),
const SizedBox(height: 16),
RichText(
text: TextSpan(
style: TextStyle(
color: Colors.white.withValues(alpha: 0.7),
fontSize: 13,
height: 1.4,
fontFamily: 'Manrope',
child: Container(
width: double.infinity,
padding: EdgeInsets.fromLTRB(32, 26, 32, mediaQuery.padding.bottom + 8),
decoration: const BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.only(topLeft: Radius.circular(40), topRight: Radius.circular(40)),
),
child: SafeArea(
top: false,
Comment on lines +49 to +55

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Double bottom safe-area padding

The Container already sets padding.bottom = mediaQuery.padding.bottom + 8, and then SafeArea(top: false) adds another mediaQuery.padding.bottom below the inner Column's content. On a device with a 34 pt home-indicator inset (iPhone 15 Pro) the button ends up sitting 76 pt above the card's bottom edge instead of the intended ~42 pt — noticeably floating when viewed at default text size. Removing one of the two accounting mechanisms (either drop SafeArea and keep the manual padding, or zero out the manual bottom padding and rely purely on SafeArea) would fix the over-spacing. This behaviour predated this PR but the refactor is a good opportunity to clean it up.

child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
context.l10n.dataAndPrivacy,
style: const TextStyle(
color: Colors.white,
fontSize: 28,
fontWeight: FontWeight.bold,
height: 1.2,
fontFamily: 'Manrope',
),
),
const SizedBox(height: 16),
Text(
context.l10n.consentDataMessage,
style:
const TextStyle(color: Colors.white, fontSize: 15, height: 1.5, fontFamily: 'Manrope'),
),
const SizedBox(height: 16),
RichText(
text: TextSpan(
style: TextStyle(
color: Colors.white.withValues(alpha: 0.7),
fontSize: 13,
height: 1.4,
fontFamily: 'Manrope',
),
children: [
TextSpan(text: context.l10n.yourDataIsProtected),
TextSpan(
text: context.l10n.privacyPolicy,
style: const TextStyle(color: Colors.white, decoration: TextDecoration.underline),
recognizer: _privacyRecognizer,
),
TextSpan(text: context.l10n.and),
TextSpan(
text: context.l10n.termsOfService,
style: const TextStyle(color: Colors.white, decoration: TextDecoration.underline),
recognizer: _termsRecognizer,
),
const TextSpan(text: '.'),
],
),
),
],
),
),
children: [
TextSpan(text: context.l10n.yourDataIsProtected),
TextSpan(
text: context.l10n.privacyPolicy,
style: const TextStyle(color: Colors.white, decoration: TextDecoration.underline),
recognizer: _privacyRecognizer,
),
const SizedBox(height: 28),
SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton(
onPressed: widget.onAgree,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
foregroundColor: Colors.black,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(28)),
elevation: 0,
),
TextSpan(text: context.l10n.and),
TextSpan(
text: context.l10n.termsOfService,
style: const TextStyle(color: Colors.white, decoration: TextDecoration.underline),
recognizer: _termsRecognizer,
child: Text(
context.l10n.agreeAndContinue,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600, fontFamily: 'Manrope'),
),
const TextSpan(text: '.'),
],
),
),
const SizedBox(height: 28),
SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton(
onPressed: widget.onAgree,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
foregroundColor: Colors.black,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(28)),
elevation: 0,
),
child: Text(
context.l10n.agreeAndContinue,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600, fontFamily: 'Manrope'),
),
),
),
],
],
),
),
),
),
Expand Down
Loading