|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:go_router/go_router.dart'; |
| 3 | +import 'package:ui_kit/ui_kit.dart'; |
| 4 | + |
| 5 | +/// {@template demo_interstitial_ad_dialog} |
| 6 | +/// A dialog widget that displays a placeholder for an interstitial ad in demo mode. |
| 7 | +/// |
| 8 | +/// This dialog mimics a full-screen interstitial ad but contains only static |
| 9 | +/// text to indicate it's a demo. |
| 10 | +/// {@endtemplate} |
| 11 | +class DemoInterstitialAdDialog extends StatelessWidget { |
| 12 | + /// {@macro demo_interstitial_ad_dialog} |
| 13 | + const DemoInterstitialAdDialog({super.key}); |
| 14 | + |
| 15 | + @override |
| 16 | + Widget build(BuildContext context) { |
| 17 | + final theme = Theme.of(context); |
| 18 | + return Dialog.fullscreen( |
| 19 | + backgroundColor: theme.colorScheme.surface, |
| 20 | + child: Stack( |
| 21 | + children: [ |
| 22 | + Center( |
| 23 | + child: SingleChildScrollView( |
| 24 | + child: Column( |
| 25 | + mainAxisAlignment: MainAxisAlignment.center, |
| 26 | + children: [ |
| 27 | + Text( |
| 28 | + 'INTERSTITIAL AD (DEMO)', |
| 29 | + style: theme.textTheme.titleLarge?.copyWith( |
| 30 | + color: theme.colorScheme.onSurface, |
| 31 | + ), |
| 32 | + textAlign: TextAlign.center, |
| 33 | + ), |
| 34 | + const SizedBox(height: AppSpacing.md), |
| 35 | + Text( |
| 36 | + 'This is a full-screen advertisement placeholder.', |
| 37 | + style: theme.textTheme.bodyMedium?.copyWith( |
| 38 | + color: theme.colorScheme.onSurfaceVariant, |
| 39 | + ), |
| 40 | + textAlign: TextAlign.center, |
| 41 | + ), |
| 42 | + ], |
| 43 | + ), |
| 44 | + ), |
| 45 | + ), |
| 46 | + Positioned( |
| 47 | + top: AppSpacing.lg, |
| 48 | + right: AppSpacing.lg, |
| 49 | + child: IconButton( |
| 50 | + icon: Icon(Icons.close, color: theme.colorScheme.onSurface), |
| 51 | + onPressed: () { |
| 52 | + // Dismiss the dialog. |
| 53 | + Navigator.of(context).pop(); |
| 54 | + }, |
| 55 | + ), |
| 56 | + ), |
| 57 | + ], |
| 58 | + ), |
| 59 | + ); |
| 60 | + } |
| 61 | +} |
0 commit comments