Settings actions: messages and radio progress
Every action ends with a short message: Sync Time ("Time sent to the
radio"), Refresh Contacts, Reboot and Delete All Paths. While Refresh
Contacts or Reboot wait for the radio, the row shows a spinner
(MeshNavTile busy) and the app bar the shared progress bar. Delete All
Paths now says it clears the app's path history.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c45424adaa
commit
5b74383d10
46 files changed
+637
-104
No files matched your search
@@ -44,6 +44,10 @@ class MeshNavTile extends StatelessWidget {
|
||||
final Color? titleColor;
|
||||
final Color? iconColor;
|
||||
final bool showChevron;
|
||||
|
||||
/// Shows the 18px spinner in place of the chevron and ignores taps while
|
||||
/// the row's action runs (e.g. a radio command). The row isn't dimmed.
|
||||
final bool busy;
|
||||
final Widget? trailing;
|
||||
final int? subtitleMaxLines;
|
||||
final EdgeInsetsGeometry padding;
|
||||
@@ -58,6 +62,7 @@ class MeshNavTile extends StatelessWidget {
|
||||
this.titleColor,
|
||||
this.iconColor,
|
||||
this.showChevron = true,
|
||||
this.busy = false,
|
||||
this.trailing,
|
||||
this.subtitleMaxLines,
|
||||
this.padding = const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
@@ -104,7 +109,17 @@ class MeshNavTile extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
?trailing,
|
||||
if (showChevron && trailing == null)
|
||||
if (busy && trailing == null)
|
||||
const SizedBox.square(
|
||||
dimension: 24,
|
||||
child: Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
),
|
||||
)
|
||||
else if (showChevron && trailing == null)
|
||||
Icon(Icons.chevron_right, color: scheme.onSurfaceVariant, size: 24),
|
||||
],
|
||||
);
|
||||
@@ -112,9 +127,9 @@ class MeshNavTile extends StatelessWidget {
|
||||
return MergeSemantics(
|
||||
child: Semantics(
|
||||
button: true,
|
||||
enabled: enabled,
|
||||
enabled: enabled && !busy,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
onTap: busy ? null : onTap,
|
||||
child: Padding(
|
||||
padding: padding,
|
||||
// Dimmed rather than recoloured so warn/alert tints still read as
|
||||
|
||||
@@ -45,7 +45,11 @@ class MeshProgressAppBarBottom extends StatelessWidget
|
||||
/// contacts, channels and queued messages, one at a time.
|
||||
class SyncProgressAppBarBottom extends StatelessWidget
|
||||
implements PreferredSizeWidget {
|
||||
const SyncProgressAppBarBottom({super.key});
|
||||
/// Also shows the bar, moving, while the screen waits for the radio and no
|
||||
/// sync is running.
|
||||
final bool busy;
|
||||
|
||||
const SyncProgressAppBarBottom({super.key, this.busy = false});
|
||||
|
||||
@override
|
||||
Size get preferredSize => const Size.fromHeight(MeshProgressBar.height);
|
||||
@@ -54,7 +58,11 @@ class SyncProgressAppBarBottom extends StatelessWidget
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<MeshCoreConnector>(
|
||||
builder: (context, connector, _) {
|
||||
final state = _SyncProgressState.fromConnector(connector);
|
||||
final state =
|
||||
_SyncProgressState.fromConnector(connector) ??
|
||||
(busy && connector.isConnected
|
||||
? const _SyncProgressState(value: null)
|
||||
: null);
|
||||
return MeshProgressBar(active: state != null, value: state?.value);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user