fix(app): Notifications is a Settings section with the shared heading and inset
This commit is contained in:
@@ -62,49 +62,24 @@ class NotificationPermissionTile extends StatelessWidget {
|
||||
: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
);
|
||||
// The Settings section supplies the `Notifications` heading and the page
|
||||
// inset, as for every other section, so the body starts at that edge.
|
||||
return Column(
|
||||
key: notificationTileKey,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
native
|
||||
? CupertinoListTile(
|
||||
key: notificationTileKey,
|
||||
leading: const Icon(CupertinoIcons.bell),
|
||||
title: const Text(notificationSectionTitle),
|
||||
)
|
||||
: ListTile(
|
||||
key: notificationTileKey,
|
||||
leading: const Icon(Icons.notifications_outlined),
|
||||
title: const Text(notificationSectionTitle),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(notificationRationale, style: bodyStyle),
|
||||
const SizedBox(height: 8),
|
||||
Semantics(
|
||||
liveRegion: true,
|
||||
child: Text(
|
||||
view.body,
|
||||
key: notificationStateKey,
|
||||
style: bodyStyle,
|
||||
),
|
||||
),
|
||||
// The action sits on its own row, as the browser's settings
|
||||
// section does: a native button in a row's trailing slot would
|
||||
// squeeze the section title to one character per line at large
|
||||
// text, and its label is too long to share the row.
|
||||
if (action != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: action,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
Text(notificationRationale, style: bodyStyle),
|
||||
const SizedBox(height: 8),
|
||||
Semantics(
|
||||
liveRegion: true,
|
||||
child: Text(view.body, key: notificationStateKey, style: bodyStyle),
|
||||
),
|
||||
// The action sits on its own row, as the browser's settings section
|
||||
// does: its label is too long to share a row at large text.
|
||||
if (action != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
Align(alignment: AlignmentDirectional.centerStart, child: action),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../core/transport/pipelines_client.dart' as transport;
|
||||
import '../attention/notify/notification_controller.dart';
|
||||
import '../attention/notify/notification_models.dart';
|
||||
import 'default_endpoint.dart';
|
||||
import 'settings_controller.dart';
|
||||
import 'settings_controls.dart';
|
||||
@@ -149,9 +150,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
),
|
||||
if (widget.notifications != null) ...<Widget>[
|
||||
const SizedBox(height: settingsSectionGap),
|
||||
// The permission tile draws its own compact title row, so
|
||||
// Settings must not add a second "Notifications" heading.
|
||||
_SettingsSection(
|
||||
title: notificationSectionTitle,
|
||||
child: SettingsNotificationsSection(
|
||||
controller: widget.notifications!,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user