feat(app): add manual entry and sharing flows
This commit is contained in:
@@ -15,51 +15,48 @@ import 'domain/entities/recommendation_record.dart';
|
||||
import 'domain/entities/user_settings.dart';
|
||||
import 'presentation/pages/splash/splash_screen.dart';
|
||||
import 'presentation/pages/main/main_screen.dart';
|
||||
import 'data/sample/sample_data_initializer.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
|
||||
// Initialize timezone
|
||||
tz.initializeTimeZones();
|
||||
|
||||
|
||||
// Initialize Hive
|
||||
await Hive.initFlutter();
|
||||
|
||||
|
||||
// Register Hive Adapters
|
||||
Hive.registerAdapter(RestaurantAdapter());
|
||||
Hive.registerAdapter(DataSourceAdapter());
|
||||
Hive.registerAdapter(VisitRecordAdapter());
|
||||
Hive.registerAdapter(RecommendationRecordAdapter());
|
||||
Hive.registerAdapter(UserSettingsAdapter());
|
||||
|
||||
|
||||
// Open Hive Boxes
|
||||
await Hive.openBox<Restaurant>(AppConstants.restaurantBox);
|
||||
await Hive.openBox<VisitRecord>(AppConstants.visitRecordBox);
|
||||
await Hive.openBox<RecommendationRecord>(AppConstants.recommendationBox);
|
||||
await Hive.openBox(AppConstants.settingsBox);
|
||||
await Hive.openBox<UserSettings>('user_settings');
|
||||
|
||||
await SampleDataInitializer.seedManualRestaurantsIfNeeded();
|
||||
|
||||
// Initialize Notification Service (only for non-web platforms)
|
||||
if (!kIsWeb) {
|
||||
final notificationService = NotificationService();
|
||||
await notificationService.initialize();
|
||||
await notificationService.requestPermission();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Get saved theme mode
|
||||
final savedThemeMode = await AdaptiveTheme.getThemeMode();
|
||||
|
||||
runApp(
|
||||
ProviderScope(
|
||||
child: LunchPickApp(savedThemeMode: savedThemeMode),
|
||||
),
|
||||
);
|
||||
|
||||
runApp(ProviderScope(child: LunchPickApp(savedThemeMode: savedThemeMode)));
|
||||
}
|
||||
|
||||
class LunchPickApp extends StatelessWidget {
|
||||
final AdaptiveThemeMode? savedThemeMode;
|
||||
|
||||
|
||||
const LunchPickApp({super.key, this.savedThemeMode});
|
||||
|
||||
@override
|
||||
@@ -141,10 +138,7 @@ class LunchPickApp extends StatelessWidget {
|
||||
final _router = GoRouter(
|
||||
initialLocation: '/',
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/',
|
||||
builder: (context, state) => const SplashScreen(),
|
||||
),
|
||||
GoRoute(path: '/', builder: (context, state) => const SplashScreen()),
|
||||
GoRoute(
|
||||
path: '/home',
|
||||
builder: (context, state) {
|
||||
@@ -173,4 +167,4 @@ final _router = GoRouter(
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user