Add a small curated catalog of Iberian horticultural species and let a variety be linked to it from the edit sheet. - assets/catalog/species.json: 14 species with botanical family and ES/EN common names (wikidata_qid/gbif_key deferred to the varilla enrichment). - SpeciesRepository: idempotent seedBundled (is_bundled rows, keyed by scientific name) + search by scientific/common name with a locale-best label. Seeded on startup from DI. - VarietyRepository.linkSpecies: sets species_id and prefills category from the species' family when empty (never overwrites an existing category). VarietyDetail now carries the scientific name. - Edit sheet gains a live species-search field; the detail view shows the scientific name (italic). i18n strings added (ES/EN). Tests: catalog parse, idempotent seeding, search by scientific/common name, linkSpecies prefill semantics, and a widget test for the autocomplete → link → scientific-name-shown flow. Full suite: 32 passing, 0 skipped.
21 lines
514 B
Dart
21 lines
514 B
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';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
LocaleSettings.useDeviceLocaleSync();
|
|
await configureDependencies();
|
|
runApp(
|
|
TranslationProvider(
|
|
child: TaneApp(
|
|
repository: getIt<VarietyRepository>(),
|
|
species: getIt<SpeciesRepository>(),
|
|
),
|
|
),
|
|
);
|
|
}
|