Files
meshcore-open/lib/widgets/radio_disconnected_banner.dart
T
zjs81 88dcc5943f UI refresh: shared widgets, screen cleanups, and full translations
- Extract reusable widgets (chat composer/send pipeline, message bubble
  frame, reaction chips, path map scaffold, radio settings dialog,
  translation settings section, map POI clusters, nav tiles, etc.) and
  slim down the screens that used them
- Map: hide/remove markers with restore, confirm before setting node
  location, POI clustering, semantics labels
- Map cache: cancellable downloads and a bulk tile limit
- Repeater: unsaved-changes guard, CLI search/copy/share transcript,
  framed-command debug preview, disconnected banner
- Confirm before clearing chats and debug logs
- Keep cached unread totals in sync on per-contact/channel updates
- Move remaining hardcoded strings into l10n and translate the 98 new
  keys into all 17 non-English locales
2026-10-11 15:17:01 -07:00

59 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../connector/meshcore_connector.dart';
import '../l10n/l10n.dart';
/// Inline warning shown at the top of repeater screens while the companion
/// radio is disconnected. Renders nothing while connected.
class RadioDisconnectedBanner extends StatelessWidget {
const RadioDisconnectedBanner({super.key});
@override
Widget build(BuildContext context) {
final connected = context.select<MeshCoreConnector, bool>(
(c) => c.isConnected,
);
if (connected) return const SizedBox.shrink();
final scheme = Theme.of(context).colorScheme;
final textTheme = Theme.of(context).textTheme;
return Semantics(
liveRegion: true,
child: Material(
color: scheme.errorContainer,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
children: [
Icon(Icons.link_off, size: 24, color: scheme.onErrorContainer),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
context.l10n.repeater_radioDisconnected,
style: textTheme.titleSmall?.copyWith(
color: scheme.onErrorContainer,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 2),
Text(
context.l10n.repeater_radioDisconnectedHint,
style: textTheme.bodyMedium?.copyWith(
color: scheme.onErrorContainer,
),
),
],
),
),
],
),
),
),
);
}
}