Closes the profile loop — peers now appear by name, not a raw key. - ProfileCache: keystore-backed cache of peers' published display names (works offline) + shortPubkey() fallback. - Chat: the app bar shows the peer's name (cached first, then freshened from their kind:0 over the session); falls back to a short key. - Inbox: each conversation shows the cached name, and missing names are resolved over one session and cached. - Wired via DI + TaneApp(profileCache). Analyzer clean; ProfileCache covered by a plain test.
43 lines
1.4 KiB
Dart
43 lines
1.4 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
import 'app.dart';
|
|
import 'data/species_repository.dart';
|
|
import 'data/variety_repository.dart';
|
|
import 'di/injector.dart';
|
|
import 'i18n/strings.g.dart';
|
|
import 'services/auto_backup_service.dart';
|
|
import 'services/coarse_location.dart';
|
|
import 'services/message_store.dart';
|
|
import 'services/offer_outbox.dart';
|
|
import 'services/onboarding_store.dart';
|
|
import 'services/profile_cache.dart';
|
|
import 'services/profile_store.dart';
|
|
import 'services/social_service.dart';
|
|
import 'services/social_settings.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
LocaleSettings.useDeviceLocaleSync();
|
|
await configureDependencies();
|
|
final onboarding = getIt<OnboardingStore>();
|
|
runApp(
|
|
TranslationProvider(
|
|
child: TaneApp(
|
|
repository: getIt<VarietyRepository>(),
|
|
species: getIt<SpeciesRepository>(),
|
|
onboarding: onboarding,
|
|
social: getIt<SocialService>(),
|
|
socialSettings: getIt<SocialSettings>(),
|
|
location: const GeolocatorCoarseLocation(),
|
|
outbox: getIt<OfferOutbox>(),
|
|
messageStore: getIt<MessageStore>(),
|
|
profileStore: getIt<ProfileStore>(),
|
|
profileCache: getIt<ProfileCache>(),
|
|
showIntro: !await onboarding.introSeen(),
|
|
autoBackup: getIt.isRegistered<AutoBackupService>()
|
|
? getIt<AutoBackupService>()
|
|
: null,
|
|
),
|
|
),
|
|
);
|
|
}
|