Merge upstream/dev (8 commits) [upstream-sync]
This commit is contained in:
commit
65097d053d
76 files changed
+2533
-1050
No files matched your search
@@ -36,28 +36,32 @@ void showChannelNotificationModeSheet(BuildContext context, String muteKey) {
|
||||
builder: (sheetContext) {
|
||||
final scheme = Theme.of(sheetContext).colorScheme;
|
||||
return SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (final mode in ChannelNotificationMode.values)
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
channelNotificationModeIcon(mode),
|
||||
color: mode == currentMode
|
||||
? scheme.primary
|
||||
: scheme.onSurfaceVariant,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (final mode in ChannelNotificationMode.values)
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
channelNotificationModeIcon(mode),
|
||||
color: mode == currentMode
|
||||
? scheme.primary
|
||||
: scheme.onSurfaceVariant,
|
||||
),
|
||||
title: Text(channelNotificationModeLabel(sheetContext, mode)),
|
||||
trailing: mode == currentMode
|
||||
? const Icon(Icons.check)
|
||||
: null,
|
||||
onTap: () async {
|
||||
Navigator.pop(sheetContext);
|
||||
await settingsService.setChannelNotificationMode(
|
||||
muteKey,
|
||||
mode,
|
||||
);
|
||||
},
|
||||
),
|
||||
title: Text(channelNotificationModeLabel(sheetContext, mode)),
|
||||
trailing: mode == currentMode ? const Icon(Icons.check) : null,
|
||||
onTap: () async {
|
||||
Navigator.pop(sheetContext);
|
||||
await settingsService.setChannelNotificationMode(
|
||||
muteKey,
|
||||
mode,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -41,12 +41,11 @@ IconData? contactTypeIcon(int type) {
|
||||
}
|
||||
|
||||
/// The most recent activity for [contact]: for chat nodes this includes the
|
||||
/// last message, for other node types only the last advert.
|
||||
/// last message, for other node types only the last advert or telemetry fix.
|
||||
DateTime resolveContactLastSeen(Contact contact) {
|
||||
if (contact.type != advTypeChat) return contact.lastSeen;
|
||||
return contact.lastMessageAt.isAfter(contact.lastSeen)
|
||||
? contact.lastMessageAt
|
||||
: contact.lastSeen;
|
||||
final heard = contact.lastHeard;
|
||||
if (contact.type != advTypeChat) return heard;
|
||||
return contact.lastMessageAt.isAfter(heard) ? contact.lastMessageAt : heard;
|
||||
}
|
||||
|
||||
/// Short relative "last seen" label ("now", "5 mins ago", "2 days ago").
|
||||
|
||||
@@ -55,56 +55,70 @@ class _EmptyStateState extends State<EmptyState>
|
||||
begin: const Offset(0, 0.06),
|
||||
end: Offset.zero,
|
||||
).animate(_curve),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 80,
|
||||
height: 80,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: scheme.primary.withValues(alpha: 0.08),
|
||||
border: Border.all(
|
||||
color: scheme.primary.withValues(alpha: 0.18),
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
widget.icon,
|
||||
size: 36,
|
||||
color: scheme.onSurfaceVariant,
|
||||
// Scrolls instead of overflowing when a short screen or a large text
|
||||
// scale makes the content taller than the space it gets.
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) => SingleChildScrollView(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: constraints.hasBoundedHeight
|
||||
? constraints.maxHeight
|
||||
: 0,
|
||||
),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: 80,
|
||||
height: 80,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: scheme.primary.withValues(alpha: 0.08),
|
||||
border: Border.all(
|
||||
color: scheme.primary.withValues(alpha: 0.18),
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
widget.icon,
|
||||
size: 36,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
widget.title,
|
||||
style: Theme.of(context).textTheme.titleMedium
|
||||
?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: scheme.onSurface,
|
||||
letterSpacing: -0.1,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (widget.subtitle != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
widget.subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: 13.5,
|
||||
color: scheme.onSurfaceVariant,
|
||||
height: 1.45,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
if (widget.action != null) ...[
|
||||
const SizedBox(height: 28),
|
||||
widget.action!,
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
widget.title,
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: scheme.onSurface,
|
||||
letterSpacing: -0.1,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (widget.subtitle != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
widget.subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: 13.5,
|
||||
color: scheme.onSurfaceVariant,
|
||||
height: 1.45,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
if (widget.action != null) ...[
|
||||
const SizedBox(height: 28),
|
||||
widget.action!,
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
@@ -55,7 +57,8 @@ void showLanguagePickerSheet(
|
||||
children: [
|
||||
BottomSheetHeader(title: l10n.appSettings_language),
|
||||
SizedBox(
|
||||
height: 400,
|
||||
// Capped so the sheet still fits short screens and landscape.
|
||||
height: math.min(400, MediaQuery.sizeOf(ctx).height * 0.6),
|
||||
child: ListView(
|
||||
children: [
|
||||
for (final (code, label) in appLanguageOptions)
|
||||
|
||||
@@ -262,7 +262,7 @@ void showNodeInfoSheet(
|
||||
),
|
||||
NodeInfoRow(
|
||||
label: l10n.map_lastSeen,
|
||||
value: formatNodeLastSeen(l10n, contact.lastSeen),
|
||||
value: formatNodeLastSeen(l10n, contact.lastHeard),
|
||||
),
|
||||
NodeInfoRow(
|
||||
label: l10n.map_publicKey,
|
||||
|
||||
@@ -645,6 +645,7 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
DropdownButtonFormField<LoRaBandwidth>(
|
||||
isExpanded: true,
|
||||
initialValue: _bandwidth,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.settings_bandwidth,
|
||||
@@ -652,7 +653,10 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
),
|
||||
items: LoRaBandwidth.values
|
||||
.map(
|
||||
(bw) => DropdownMenuItem(value: bw, child: Text(bw.label)),
|
||||
(bw) => DropdownMenuItem(
|
||||
value: bw,
|
||||
child: Text(bw.label, overflow: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
@@ -667,6 +671,7 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
DropdownButtonFormField<LoRaSpreadingFactor>(
|
||||
isExpanded: true,
|
||||
initialValue: _spreadingFactor,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.settings_spreadingFactor,
|
||||
@@ -674,7 +679,10 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
),
|
||||
items: LoRaSpreadingFactor.values
|
||||
.map(
|
||||
(sf) => DropdownMenuItem(value: sf, child: Text(sf.label)),
|
||||
(sf) => DropdownMenuItem(
|
||||
value: sf,
|
||||
child: Text(sf.label, overflow: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
@@ -691,6 +699,7 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
DropdownButtonFormField<LoRaCodingRate>(
|
||||
isExpanded: true,
|
||||
initialValue: _codingRate,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.settings_codingRate,
|
||||
@@ -698,7 +707,10 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
),
|
||||
items: LoRaCodingRate.values
|
||||
.map(
|
||||
(cr) => DropdownMenuItem(value: cr, child: Text(cr.label)),
|
||||
(cr) => DropdownMenuItem(
|
||||
value: cr,
|
||||
child: Text(cr.label, overflow: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
@@ -716,6 +728,7 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
// Values are path hash modes (0-2, byte width - 1), matching
|
||||
// the selectors in settings_screen and repeater_settings_screen.
|
||||
DropdownButtonFormField<int>(
|
||||
isExpanded: true,
|
||||
initialValue: (_pathHashByteWidth - 1).clamp(0, 2).toInt(),
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.repeater_pathHashMode,
|
||||
@@ -726,15 +739,24 @@ class _RadioSettingsDialogState extends State<RadioSettingsDialog> {
|
||||
items: [
|
||||
DropdownMenuItem(
|
||||
value: 0,
|
||||
child: Text(l10n.repeater_pathHashModeOption0),
|
||||
child: Text(
|
||||
l10n.repeater_pathHashModeOption0,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 1,
|
||||
child: Text(l10n.repeater_pathHashModeOption1),
|
||||
child: Text(
|
||||
l10n.repeater_pathHashModeOption1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 2,
|
||||
child: Text(l10n.repeater_pathHashModeOption2),
|
||||
child: Text(
|
||||
l10n.repeater_pathHashModeOption2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
|
||||
@@ -313,6 +313,7 @@ class _RoutingSheetBodyState extends State<_RoutingSheetBody> {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (dialogContext) => AlertDialog(
|
||||
scrollable: true,
|
||||
title: Text(l10n.chat_fullPath),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
Reference in new issue
Block a user