Files
meshcore-open/lib/models/map_path_trace_draft.dart
zjs81 c939f7a29c Add Czech, in-chat search, typed-hash path trace and contact sharing
- Czech UI locale (app_cs.arb), selectable in the language picker and as a
  message translation language; language names added to every locale.
- Fix wrong language names: Slovak shown as Slovenian in it/ja/pt/sl,
  garbled Slovak/Bulgarian in pl, Ukrainian in ru, Hungarian in ko/zh.
- Search inside DM and channel chats across the full stored history, with
  highlighted matches; filtered channel messages are excluded.
- Path trace by typed hashes (e.g. A1,B2,C3) from the Contacts and map
  menus, without needing node locations; the map trace panel can hand its
  hops to it.
- Share contacts in chats using the official app's <pubkey:type:name>
  format; received cards have a one-tap Add contact button that reuses the
  QR card import path.
- Translations for all new strings in every locale; docs updated.
2026-11-07 22:31:14 -07:00

36 lines
1.0 KiB
Dart

import 'package:flutter/foundation.dart';
import 'package:latlong2/latlong.dart';
import 'contact.dart';
/// The map's path-trace builder state: the hops picked so far, the trace
/// mode and the last result. Held by [UiViewStateService] for the app session
/// so leaving the map or opening the result doesn't discard it.
class MapPathTraceDraft {
bool active = false;
Uint8List? radioKey;
final List<int> pathBytes = [];
final List<int> hopWidths = [];
final List<Contact> contacts = [];
final List<LatLng> points = [];
bool returnPath = true;
Uint8List? lastResultFrame;
/// Last text and mode entered on the manual (typed hashes) trace screen.
String manualText = '';
bool manualReturnPath = true;
bool get hasHops => pathBytes.isNotEmpty;
bool belongsTo(Uint8List? selfKey) =>
radioKey == null || selfKey == null || listEquals(radioKey, selfKey);
void clear() {
pathBytes.clear();
hopWidths.clear();
contacts.clear();
points.clear();
lastResultFrame = null;
}
}