Merge branch 'main' into spike/block2-derisking
# Conflicts: # apps/app_seeds/lib/app.dart # apps/app_seeds/lib/i18n/strings.g.dart # apps/app_seeds/lib/main.dart
This commit is contained in:
commit
cf99b7ff87
23 changed files with 607 additions and 25 deletions
|
|
@ -7,6 +7,7 @@ import 'package:go_router/go_router.dart';
|
|||
import 'data/species_repository.dart';
|
||||
import 'data/variety_repository.dart';
|
||||
import 'i18n/strings.g.dart';
|
||||
import 'services/auto_backup_service.dart';
|
||||
import 'services/coarse_location.dart';
|
||||
import 'services/offer_outbox.dart';
|
||||
import 'services/onboarding_store.dart';
|
||||
|
|
@ -15,6 +16,7 @@ import 'services/social_settings.dart';
|
|||
import 'state/inventory_cubit.dart';
|
||||
import 'state/variety_detail_cubit.dart';
|
||||
import 'ui/about_screen.dart';
|
||||
import 'ui/auto_backup_gate.dart';
|
||||
import 'ui/home_screen.dart';
|
||||
import 'ui/intro_screen.dart';
|
||||
import 'ui/inventory_list_screen.dart';
|
||||
|
|
@ -36,6 +38,7 @@ class TaneApp extends StatelessWidget {
|
|||
this.location,
|
||||
this.outbox,
|
||||
this.showIntro = false,
|
||||
this.autoBackup,
|
||||
super.key,
|
||||
}) : _router = _buildRouter(
|
||||
repository,
|
||||
|
|
@ -62,6 +65,10 @@ class TaneApp extends StatelessWidget {
|
|||
/// Optional offline outbox for the market's "share my seeds".
|
||||
final OfferOutbox? outbox;
|
||||
final bool showIntro;
|
||||
|
||||
/// Drives silent periodic backups off the app lifecycle. Null in widget tests
|
||||
/// and on platforms without file storage (web) — the gate then does nothing.
|
||||
final AutoBackupService? autoBackup;
|
||||
final GoRouter _router;
|
||||
|
||||
static GoRouter _buildRouter(
|
||||
|
|
@ -134,22 +141,25 @@ class TaneApp extends StatelessWidget {
|
|||
RepositoryProvider.value(value: repository),
|
||||
RepositoryProvider.value(value: species),
|
||||
],
|
||||
child: MaterialApp.router(
|
||||
onGenerateTitle: (context) => context.t.app.title,
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: buildTaneTheme(),
|
||||
// Let scrollables & PageViews be dragged with a mouse/trackpad on
|
||||
// desktop (Flutter disables that by default), so the photo carousel and
|
||||
// lists swipe there too.
|
||||
scrollBehavior: const _DragScrollBehavior(),
|
||||
locale: TranslationProvider.of(context).flutterLocale,
|
||||
supportedLocales: AppLocaleUtils.supportedLocales,
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
routerConfig: _router,
|
||||
child: AutoBackupGate(
|
||||
service: autoBackup,
|
||||
child: MaterialApp.router(
|
||||
onGenerateTitle: (context) => context.t.app.title,
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: buildTaneTheme(),
|
||||
// Let scrollables & PageViews be dragged with a mouse/trackpad on
|
||||
// desktop (Flutter disables that by default), so the photo carousel and
|
||||
// lists swipe there too.
|
||||
scrollBehavior: const _DragScrollBehavior(),
|
||||
locale: TranslationProvider.of(context).flutterLocale,
|
||||
supportedLocales: AppLocaleUtils.supportedLocales,
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
routerConfig: _router,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue