feat(ads): run consent flow (UMP->ATT->init) after the first frame
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+16
-1
@@ -1,12 +1,27 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'l10n/gen/app_localizations.dart';
|
||||
import 'state/providers.dart';
|
||||
import 'ui/screens/splash_screen.dart';
|
||||
|
||||
class BlockSeasonsApp extends StatelessWidget {
|
||||
class BlockSeasonsApp extends ConsumerStatefulWidget {
|
||||
const BlockSeasonsApp({super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<BlockSeasonsApp> createState() => _BlockSeasonsAppState();
|
||||
}
|
||||
|
||||
class _BlockSeasonsAppState extends ConsumerState<BlockSeasonsApp> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
ref.read(consentServiceProvider).ensureConsentAndInitialize();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
|
||||
Reference in New Issue
Block a user