mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
fix: Reset fallback sharing state
This commit is contained in:
@@ -320,7 +320,7 @@ class _ContactRouteDialogState extends State<ContactRouteDialog> {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Selected relays', style: Theme.of(context).textTheme.titleSmall),
|
||||
Text(AppLocalizations.of(context)!.selectedRelays, style: Theme.of(context).textTheme.titleSmall),
|
||||
const SizedBox(height: 8),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
@@ -355,11 +355,11 @@ class _ContactRouteDialogState extends State<ContactRouteDialog> {
|
||||
TextField(
|
||||
controller: _relaySearchController,
|
||||
onChanged: (_) => setState(() {}),
|
||||
decoration: const InputDecoration(
|
||||
prefixIcon: Icon(Icons.search),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
labelText: 'Find relay',
|
||||
hintText: 'Search by name or token',
|
||||
border: OutlineInputBorder(),
|
||||
hintText: AppLocalizations.of(context)!.searchByNameOrToken,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
@@ -509,7 +509,7 @@ class _ContactRouteDialogState extends State<ContactRouteDialog> {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text('Path size', style: Theme.of(context).textTheme.labelLarge),
|
||||
Text(AppLocalizations.of(context)!.pathSize, style: Theme.of(context).textTheme.labelLarge),
|
||||
const Spacer(),
|
||||
SegmentedButton<int>(
|
||||
segments: [
|
||||
@@ -621,7 +621,7 @@ class _ContactRouteDialogState extends State<ContactRouteDialog> {
|
||||
length: 2,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Set Path for ${widget.contact.displayName}'),
|
||||
title: Text(AppLocalizations.of(context)!.setPathForContact(widget.contact.displayName)),
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(text: 'Build'),
|
||||
|
||||
@@ -437,6 +437,7 @@ class ContactTile extends StatelessWidget {
|
||||
final result = await context.read<AppProvider>().setChannelLocationSharingEnabled(
|
||||
channelIdx,
|
||||
enabled,
|
||||
l10n: AppLocalizations.of(context),
|
||||
);
|
||||
if (!context.mounted) return;
|
||||
ToastLogger.success(context, result.message);
|
||||
@@ -655,7 +656,7 @@ class ContactTile extends StatelessWidget {
|
||||
if (contact.type == ContactType.repeater)
|
||||
_ContactSheetAction(
|
||||
icon: Icons.hub_outlined,
|
||||
label: 'View Neighbours',
|
||||
label: AppLocalizations.of(context)!.viewNeighbours,
|
||||
onTap: () async {
|
||||
Navigator.pop(context);
|
||||
_showNeighbours(context, contact);
|
||||
@@ -665,7 +666,7 @@ class ContactTile extends StatelessWidget {
|
||||
contact.type == ContactType.room)
|
||||
_ContactSheetAction(
|
||||
icon: Icons.network_ping,
|
||||
label: 'Ping',
|
||||
label: AppLocalizations.of(context)!.ping,
|
||||
onTap: () async {
|
||||
Navigator.pop(context);
|
||||
_pingRelay(context, contact);
|
||||
@@ -2395,7 +2396,7 @@ class _NeighboursSheetState extends State<_NeighboursSheet> {
|
||||
),
|
||||
)
|
||||
: _neighbours.isEmpty
|
||||
? const Center(child: Text('No neighbours found'))
|
||||
? Center(child: Text(AppLocalizations.of(context)!.noNeighboursFound))
|
||||
: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 4, 16, 16),
|
||||
child: Column(
|
||||
@@ -2768,7 +2769,7 @@ class _PingRelaySheetState extends State<_PingRelaySheet> {
|
||||
IconButton(
|
||||
onPressed: () => setState(() => _history.clear()),
|
||||
icon: const Icon(Icons.delete_outline, size: 20),
|
||||
tooltip: 'Clear history',
|
||||
tooltip: AppLocalizations.of(context)!.clearHistory,
|
||||
style: IconButton.styleFrom(
|
||||
foregroundColor: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:flutter_map/flutter_map.dart' as flutter_map;
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../../models/contact.dart';
|
||||
import '../../providers/connection_provider.dart';
|
||||
import '../../providers/contacts_provider.dart';
|
||||
@@ -84,7 +85,7 @@ class _ContactTraceSheetState extends State<ContactTraceSheet> {
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Text('Failed to load trace: ${snapshot.error}'),
|
||||
child: Text(AppLocalizations.of(context)!.failedToLoadTrace(snapshot.error.toString())),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user