mirror of
https://github.com/flutter/holobooth.git
synced 2025-05-17 13:25:59 +08:00

<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Description Changes: - Bump min dart SDK to 2.19.0 - Bump Flutter version to 3.7.12 - Used Very Good Analysis 4.0.0 - Corrected new analyzer issues - Dart format ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 Code refactor - [ ] ✅ Build configuration change - [ ] 📝 Documentation - [X] 🗑️ Chore
74 lines
2.5 KiB
Dart
74 lines
2.5 KiB
Dart
import 'package:analytics_repository/analytics_repository.dart';
|
|
import 'package:authentication_repository/authentication_repository.dart';
|
|
import 'package:avatar_detector_repository/avatar_detector_repository.dart';
|
|
import 'package:convert_repository/convert_repository.dart';
|
|
import 'package:download_repository/download_repository.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:holobooth/audio_player/audio_player.dart';
|
|
import 'package:holobooth/l10n/l10n.dart';
|
|
import 'package:holobooth/landing/landing.dart';
|
|
import 'package:holobooth/rive/rive.dart';
|
|
import 'package:holobooth_ui/holobooth_ui.dart';
|
|
|
|
class App extends StatelessWidget {
|
|
const App({
|
|
required this.authenticationRepository,
|
|
required this.avatarDetectorRepository,
|
|
required this.convertRepository,
|
|
required this.downloadRepository,
|
|
required this.analyticsRepository,
|
|
super.key,
|
|
});
|
|
|
|
final AuthenticationRepository authenticationRepository;
|
|
final AvatarDetectorRepository avatarDetectorRepository;
|
|
final ConvertRepository convertRepository;
|
|
final DownloadRepository downloadRepository;
|
|
final AnalyticsRepository analyticsRepository;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MultiRepositoryProvider(
|
|
providers: [
|
|
RepositoryProvider.value(value: authenticationRepository),
|
|
RepositoryProvider.value(value: avatarDetectorRepository),
|
|
RepositoryProvider.value(value: convertRepository),
|
|
RepositoryProvider.value(value: downloadRepository),
|
|
RepositoryProvider.value(value: analyticsRepository),
|
|
RepositoryProvider(
|
|
lazy: false,
|
|
create: (context) => RiveFileManager()..loadAllAssets(),
|
|
),
|
|
],
|
|
child: BlocProvider(
|
|
create: (context) => MuteSoundBloc(),
|
|
child: AnimatedFadeIn(
|
|
child: ResponsiveLayoutBuilder(
|
|
small: (_, __) => _AppView(theme: HoloboothTheme.small),
|
|
medium: (_, __) => _AppView(theme: HoloboothTheme.medium),
|
|
large: (_, __) => _AppView(theme: HoloboothTheme.standard),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _AppView extends StatelessWidget {
|
|
const _AppView({required this.theme});
|
|
|
|
final ThemeData theme;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Holobooth',
|
|
theme: theme,
|
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
home: const LandingPage(),
|
|
);
|
|
}
|
|
}
|