mirror of
https://github.com/spotiflacapp/SpotiFLAC-Mobile.git
synced 2026-06-01 03:15:17 +07:00
28 lines
810 B
Dart
28 lines
810 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:spotiflac_android/app.dart';
|
|
import 'package:spotiflac_android/providers/download_queue_provider.dart';
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
runApp(
|
|
ProviderScope(
|
|
child: const _EagerInitialization(
|
|
child: SpotiFLACApp(),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Widget to eagerly initialize providers that need to load data on startup
|
|
class _EagerInitialization extends ConsumerWidget {
|
|
const _EagerInitialization({required this.child});
|
|
final Widget child;
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
// Eagerly initialize download history provider to load from storage
|
|
ref.watch(downloadHistoryProvider);
|
|
return child;
|
|
}
|
|
}
|